Skip to content

feat: add select menu component entry for flow editor#291

Open
LoggeL wants to merge 7 commits into
merlinfuchs:mainfrom
LoggeL:feature/add-select-menu-component
Open

feat: add select menu component entry for flow editor#291
LoggeL wants to merge 7 commits into
merlinfuchs:mainfrom
LoggeL:feature/add-select-menu-component

Conversation

@LoggeL

@LoggeL LoggeL commented Jan 6, 2026

Copy link
Copy Markdown

Summary

This PR adds a new entry_component_select node type to the flow editor, similar to the existing entry_component_button. This allows users to create flows that are triggered when a user selects an option from a Discord select menu.

Select Menu Component

Changes

Frontend (kite-web/)

  • Created FlowNodeEntryComponentSelect.tsx component (mirrors button component)
  • Added nodeEntryComponentSelectDataSchema to dataSchema.ts
  • Registered entry_component_select in nodes.ts with "list" icon
  • Added component to components.ts registry
  • Extended FlowContextType to include component_select
  • Updated FlowNodeExplorer.tsx to show "Responses" actions for select menu flows
  • NEW: Added min_values and max_values fields to select menu schema
  • NEW: Added default field to select menu option schema
  • NEW: Added UI controls for min/max values selection (dropdowns)
  • NEW: Added Default toggle for each select menu option
  • NEW: Added state management methods (setSelectMenuMinValues, setSelectMenuMaxValues, setSelectMenuOptionDefault)

Backend (kite-service/)

  • Added FlowNodeTypeEntryComponentSelect constant to data.go
  • Added CompileComponentSelect() function to compile.go
  • Added IsComponentSelectEntry() helper method
  • Updated IsEntry() to include the new select component type
  • Updated execute.go switch case to handle select entry nodes
  • Updated message.go HandleEvent to handle StringSelectInteraction events
  • Added select menu conversion in convert.go with ToSelectOption() method
  • Added Values field to interaction context for selected values

Testing

  • Frontend TypeScript compilation passes
  • ESLint checks pass on modified files
  • Go code structure follows existing patterns
  • Manual testing via Puppeteer confirms all features work correctly

Notes

The implementation follows the same pattern as the button component. The select menu flow is triggered via the flow_source_id which corresponds to the select menu's custom_id.

New Features Added

  • Min/Max Values: Users can now configure how many options must/can be selected (0-25)
  • Default Option: Users can mark options as pre-selected by default
  • Full Discord API Support: Supports all StringSelectMenu features including placeholder, disabled state, and value limits

@vercel

vercel Bot commented Jan 6, 2026

Copy link
Copy Markdown

@LoggeL is attempting to deploy a commit to the merlinfuchs' projects Team on Vercel.

A member of the Team first needs to authorize it.

LoggeL and others added 5 commits February 1, 2026 10:46
Add entry_component_select node type similar to entry_component_button,
allowing users to create flows triggered by Discord select menu interactions.

Frontend changes:
- Add FlowNodeEntryComponentSelect component
- Register entry_component_select in node types and components
- Add nodeEntryComponentSelectDataSchema
- Add component_select to FlowContextType
- Include component_select in Responses action context

Backend changes:
- Add FlowNodeTypeEntryComponentSelect constant
- Add CompileComponentSelect function
- Add IsComponentSelectEntry helper
- Update IsEntry to include select component
- Update execute.go to handle select entry
- Update message.go to handle StringSelectInteraction
- Handle StringSelectInteraction in app.go event handler
- Add Values field to InteractionEnv for select menu selections
- Expose 'values' at top level in eval context
- Add value(index) helper function to access selected values
- Add MessageComponentSelectMenu.tsx component with full editor UI
- Enable 'Add Select Menu Row' button in MessageComponentsSection
- Render select menus in MessageComponentRow instead of placeholder text
- Add DiscordStringSelectMenu preview in MessagePreview
- Add flow_source_id to selectMenuOptionSchema for option values
- Add StringSelectComponent conversion in backend convert.go
- Add min_values and max_values fields to selectMenuSchema
- Add default field to selectMenuOptionSchema
- Add state management methods for new fields (setSelectMenuMinValues,
  setSelectMenuMaxValues, setSelectMenuOptionDefault)
- Add UI controls for min/max values selection (0-25)
- Add default toggle for each select menu option

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@LoggeL LoggeL force-pushed the feature/add-select-menu-component branch from a6ec376 to df61fc2 Compare February 1, 2026 11:05
@LemonCubeDev

Copy link
Copy Markdown

@merlinfuchs Please review/add this pull request.

@LoggeL

LoggeL commented Feb 5, 2026

Copy link
Copy Markdown
Author

Updated screenshots after fixing preview wrapping for long select placeholders:

Editor: Select Menu configuration (long placeholder/option content)

Select Menu editor

Message preview: Discord select menu render (no multiline layout break)

Select Menu preview

Flow editor dialog: entry_component_select node

Select Menu flow dialog

@Jackappleteam

Copy link
Copy Markdown

@merlinfuchs We need this!! Please add it!!

@LoggeL

LoggeL commented Feb 5, 2026

Copy link
Copy Markdown
Author

This is just a Test for AI generated PRs. I think it's pretty hard to merge. Will talk to Merlin about it tho. Maybe we can steer it in the right direction :)

Add white-space: nowrap CSS on the discord-string-select-menu host
element to prevent placeholder text from wrapping to multiple lines
in narrow preview containers. Also simplify formatPreviewSelectPlaceholder
by removing the workaround that fell back to default text on truncation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

3 participants