feat: add select menu component entry for flow editor#291
Open
LoggeL wants to merge 7 commits into
Open
Conversation
|
@LoggeL is attempting to deploy a commit to the merlinfuchs' projects Team on Vercel. A member of the Team first needs to authorize it. |
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>
a6ec376 to
df61fc2
Compare
|
@merlinfuchs Please review/add this pull request. |
Author
|
@merlinfuchs We need this!! Please add it!! |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
This PR adds a new
entry_component_selectnode type to the flow editor, similar to the existingentry_component_button. This allows users to create flows that are triggered when a user selects an option from a Discord select menu.Changes
Frontend (
kite-web/)FlowNodeEntryComponentSelect.tsxcomponent (mirrors button component)nodeEntryComponentSelectDataSchemato dataSchema.tsentry_component_selectin nodes.ts with "list" iconFlowContextTypeto includecomponent_selectmin_valuesandmax_valuesfields to select menu schemadefaultfield to select menu option schemasetSelectMenuMinValues,setSelectMenuMaxValues,setSelectMenuOptionDefault)Backend (
kite-service/)FlowNodeTypeEntryComponentSelectconstant to data.goCompileComponentSelect()function to compile.goIsComponentSelectEntry()helper methodIsEntry()to include the new select component typeHandleEventto handleStringSelectInteractioneventsToSelectOption()methodValuesfield to interaction context for selected valuesTesting
Notes
The implementation follows the same pattern as the button component. The select menu flow is triggered via the
flow_source_idwhich corresponds to the select menu'scustom_id.New Features Added