Skip to content

feat(commands/util/walkthrough): add Other options and editable answers - #60

Open
phorcys420 wants to merge 8 commits into
mainfrom
phorcys/walkthrough-other-and-edit
Open

feat(commands/util/walkthrough): add Other options and editable answers#60
phorcys420 wants to merge 8 commits into
mainfrom
phorcys/walkthrough-other-and-edit

Conversation

@phorcys420

Copy link
Copy Markdown
Member

Implements the two remaining unticked items from #1.

Changes

Other options for every question
Adds an Other (❓) option to the product and OS-family selectors (category already had one). Kept static to match the existing category Other and the stateless select-menu design (no modal/free-text, consistent with the modal approach discarded in #1).

Editable answers instead of a back button

  • Field buttons now encode walkthrough:field:<index>:<...answers>, so a click carries enough state to reopen that question. No persistent store, stays stateless.
  • handleFieldButton reopens the clicked field's selector instead of replying that it can't be edited.
  • handleSelection gained an edit branch: an edit selection replaces that answer in place and leaves later answers intact; any remaining steps continue as usual.
  • Both the field button and the edit selector are gated with the existing canMemberInteractWithThread helper (thread OP or ManageChannels). Unauthorized clicks get an ephemeral deny. The normal forward flow is unchanged.

bun format, bun lint, and bunx tsc --noEmit all pass.

Closes #1.

Decision log
  • State stays in customIds. The walkthrough is stateless by design (answers are carried in the select menu's customId). Field buttons now embed the field index plus all current answers so an edit click can rebuild the message without any external store, surviving restarts.
  • Static Other vs free-text. Chose static options for parity with the existing category Other and to avoid introducing state or a modal (the modal approach was explicitly discarded in Issue walkthrough #1). Editing an Other field just reopens the selector.
  • Edit in place, keep later answers. Editing an earlier field replaces only that value; buildMessage still renders the next unanswered step, so an incomplete walkthrough resumes naturally after an edit.
  • Permission gate. Reused canMemberInteractWithThread (OP or Manage Channels) and applied it to both the field button and the edit-select interaction, so a bystander can't drive the edit selector once it's visible. The normal forward selection flow was left ungated to avoid changing existing behaviour.

Generated by Coder Agents on behalf of @phorcys420.

@railway-app
railway-app Bot temporarily deployed to Discord bot (Codercord) / production August 12, 2026 07:29 Inactive
@railway-app
railway-app Bot temporarily deployed to Discord bot (Codercord) / production August 12, 2026 07:32 Inactive
@railway-app
railway-app Bot temporarily deployed to Discord bot (Codercord) / production August 12, 2026 07:36 Inactive
@railway-app
railway-app Bot temporarily deployed to Discord bot (Codercord) / production August 12, 2026 07:37 Inactive
@railway-app
railway-app Bot temporarily deployed to Discord bot (Codercord) / production August 12, 2026 07:41 Inactive
@railway-app
railway-app Bot temporarily deployed to Discord bot (Codercord) / production August 12, 2026 07:46 Inactive
@phorcys420
phorcys420 force-pushed the phorcys/walkthrough-other-and-edit branch from 102ca56 to 3f92998 Compare August 13, 2026 00:31
@railway-app
railway-app Bot temporarily deployed to Discord bot (Codercord) / production August 13, 2026 00:33 Inactive
Cache guild command-mention lookups and resolve edit permissions from
the interaction payload instead of fetching the guild member, so a
selection or edit re-renders without waiting on Discord REST calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue walkthrough

1 participant