Skip to content

feat(rex): Ask pickers in Rex's command palette - #54

Merged
DeepanshuMishraa merged 2 commits into
mainfrom
feat/rex-custom-ui
Nov 19, 2026
Merged

DeepanshuMishraa merged 2 commits into
mainfrom
feat/rex-custom-ui

Conversation

@DeepanshuMishraa

@DeepanshuMishraa DeepanshuMishraa commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Rex's control API 17 lets a Lua action ask in the command palette (rex.ui.pick). Open Document, Choose Agent and Change Voice now ask there.

  • Open Document…: recent documents first, then .., folders and documents. Picking a folder opens it in place; a typed path or link opens directly.
  • Choose Agent…: saves the picked agent with leaf agents --set.
  • Change Voice…: tells the reader pane to switch voice.
  • Falls back to leaf's terminal popover when the prompt is unsupported/failed or rex.ui is missing. Cancel and timeout do nothing; busy reports an error.
  • Remote sessions keep the popover, since files and agents are on the host.

New commands for the plugin (JSON on stdout):

  • leaf open --list DIR [--recent] → {kind: "folder", dir, title, items} or {kind: "document", target}
  • leaf voices --list (built-in voices if Microsoft's list takes over 6s)
  • leaf agents --list, leaf agents --set NAME|any

Testing

  • cargo test passes; new tests in src/palette.rs.
  • rex config check passes on the plugin.
  • Live: Rex app build 2044 answers unsupported, so the popover fallback ran. The palette path is untested until the app supports prompts.

🤖 Generated with Claude Code


Summary by cubic

Open Document, Choose Agent and Change Voice now ask in Rex's command palette (rex.ui.pick, add-on API 17) instead of leaf's terminal popover. The popover still opens when no app can show the prompt or the list command fails, and for remote sessions, since files and agents live on the host. Cancel and timeout do nothing; a busy prompt reports an error.

New commands (JSON on stdout for the plugin):

  • leaf open --list DIR [--recent] lists a folder or resolves to a document; recent documents come first, picking a folder opens it in place, and typed paths or links open directly.
  • leaf agents --list and leaf agents --set NAME|any list installed agents and save the pick.
  • leaf voices --list lists voices, using the built-ins if Microsoft's list takes over 6 seconds.

Fallbacks

  • Choose Agent and Change Voice check for rex.ui.pick before listing, so an older Rex goes straight to the popover without waiting on the voice list; a failed listing falls back too.
  • Open Document opens the home screen when the first listing fails (e.g. the folder is gone); a bad typed path keeps the folder shown and puts the reason in the title.
  • Rows for non-UTF-8 paths are skipped, and a non-UTF-8 folder reports that instead.

Written for commit e0914a7. Summary will update on new commits.

View guided diff Turn on auto-fix

Open Document, Choose Agent and Change Voice now ask with rex.ui.pick
(Rex control API 17+): folders open in place, a path or link can be
typed, and recent documents lead. When no app can show the prompt,
leaf's terminal popover opens as before. Remote sessions keep the
popover, since files and agents live on the host.

leaf prints the rows as JSON for the plugin:
- leaf open --list DIR [--recent]
- leaf voices --list (built-in voices after 6s without Microsoft's list)
- leaf agents --list / --set NAME|any

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread lua/leaf/init.lua Resolved
Comment thread lua/leaf/init.lua Resolved
Comment thread src/palette.rs Resolved
- Open Document opens leaf's home screen when the first listing fails
  (the pane's folder is gone, say); a bad typed path keeps the folder
  shown and puts the reason in the title.
- Choose Agent and Change Voice check rex.ui.pick before listing, so an
  older Rex goes straight to the popover without waiting on the voice
  list, and fall back to the popover when listing fails.
- Rows for paths that aren't UTF-8 are left out: the id Rex sends back
  couldn't name them. A non-UTF-8 folder reports that instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DeepanshuMishraa
DeepanshuMishraa merged commit 4163c89 into main Nov 19, 2026
9 checks passed
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.

1 participant