Default commands missing fix. #318
Closed
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.
Fixes missing default commands in TUI.
Greptile Summary
This PR fixes missing default commands in the TUI by correcting how slash commands are collected and resolves TypeScript declaration issues.
Key Changes
dialog-command.tsx: Fixedslashes()method to use the newslashfield onCommandOptionobjects instead of filtering by "/" prefix in values. The method now usesflatMapto filter commands with theslashproperty and returns proper slash command objects with display names, aliases, and onSelect handlers.custom-elements.d.tsfiles: Replaced broken symlinks inpackages/appandpackages/enterprisewith actual TypeScript declaration files containingexport {}to satisfy TypeScript module requirements.Root Cause
The original
slashes()implementation filtered options by checking ifvalue.startsWith("/"), but the actual command values don't have "/" prefixes (e.g.,"session.list","model.list"). The "/" prefix was only meant for display purposes. Commands now properly declare slash command metadata via theslashfield, which includes the command name and optional aliases.Confidence Score: 5/5
slashes()method now correctly uses theslashfield as intended by the architecture, and the TypeScript declaration files properly replace broken symlinks. All commands withslashfields inapp.tsxwill now be correctly returned.Important Files Changed
slashes()to return commands withslashfield instead of filtering by "/" prefix in valueexport {}export {}Sequence Diagram
sequenceDiagram participant User participant Autocomplete participant CommandDialog participant App User->>Autocomplete: Type "/" in prompt Autocomplete->>CommandDialog: Call slashes() CommandDialog->>CommandDialog: flatMap over options() CommandDialog->>CommandDialog: Filter options with slash field CommandDialog->>CommandDialog: Build slash command objects Note over CommandDialog: For each option with slash:<br/>- display: "/" + slash.name<br/>- aliases: slash.aliases<br/>- onSelect: trigger(option.value) CommandDialog->>Autocomplete: Return slash commands Autocomplete->>User: Display autocomplete options User->>Autocomplete: Select a command Autocomplete->>CommandDialog: Call onSelect() CommandDialog->>CommandDialog: trigger(option.value) CommandDialog->>App: Find matching option App->>App: Execute option.onSelect()