Skip to content

Add keybindable commands to navigate between user messages - #5078

Merged
rekram1-node merged 4 commits into
anomalyco:devfrom
will-marella:feature/navigate-between-messages
Dec 22, 2025
Merged

rekram1-node merged 4 commits into
anomalyco:devfrom
will-marella:feature/navigate-between-messages

Conversation

@will-marella

Copy link
Copy Markdown
Contributor

Closes #5077

Implements configurable keybinds to jump between user messages in chat.

  • Defaults to "none" to avoid keybind collisions
  • Snaps directly to user message boundaries
  • Updated keybinds.mdx documentation

@dbpolito

dbpolito commented Dec 4, 2025 •

Copy link
Copy Markdown
Contributor

This is awesome!!

I would add default to <leader>+up and <leader>+down.

@rekram1-node

Copy link
Copy Markdown
Collaborator

intentionally not setting default to avoid issues rn, we can add a default later on. Some keybind stuff is in flux rn

@rekram1-node

Copy link
Copy Markdown
Collaborator

/review

@ariane-emory

Copy link
Copy Markdown
Contributor

@will-marella This should probably include a check similar to !part.synthetic && !part.ignored to avoid moving to messages that were actually produced by plugins and not typed by the user. Moving between plugin-produced messages is likely not the behaviour that was intended or that users would expect from these commands.

@will-marella will-marella changed the title Add keybind to navigate between user messages Add keybindable commands to navigate between user messages Dec 4, 2025
@will-marella

Copy link
Copy Markdown
Contributor Author

@will-marella This should probably include a check similar to !part.synthetic && !part.ignored to avoid moving to messages that were actually produced by plugins and not typed by the user. Moving between plugin-produced messages is likely not the behaviour that was intended or that users would expect from these commands.

This filter is now added with the same logic as messages_last_user

@rekram1-node

Copy link
Copy Markdown
Collaborator

/review

Will@Cambridge and others added 4 commits December 5, 2025 10:26
…bind (defaults to 'none') - Snaps to previous/next user message boundaries - Updates keybinds documentation Closes anomalyco#5077”
- Type dialog parameter with ReturnType<typeof useDialog>
- Use non-mutating reverse with spread operator
- Deduplicate dialog.clear() using guard clause pattern

The bot suggested using else to avoid duplication, but the style guide
discourages else statements. Used early return guard clause instead,
which achieves the same deduplication while following style conventions.
@will-marella
will-marella force-pushed the feature/navigate-between-messages branch from 3481141 to 7d4d86b Compare December 5, 2025 15:26
@will-marella

Copy link
Copy Markdown
Contributor Author

Rebased on latest dev and addressed all code review feedback:

Typed dialog parameter with ReturnType
Used non-mutating reverse with spread operator
Refactored to guard clause pattern to deduplicate dialog.clear() while avoiding else per style guide

Note: Pushed with --no-verify due to typecheck errors in upstream packages unrelated to this PR. My changes typecheck cleanly when checked in isolation.

@rekram1-node

Copy link
Copy Markdown
Collaborator

/review

@github-actions

Copy link
Copy Markdown
Contributor

lgtm

@rekram1-node
rekram1-node merged commit af214d3 into anomalyco:dev Dec 22, 2025
3 checks passed
rekram1-node pushed a commit that referenced this pull request Dec 27, 2025
github-actions Bot pushed a commit to yuguorui/opencode that referenced this pull request Jan 18, 2026
burgercrisis pushed a commit to burgercrisis/opencode that referenced this pull request Jan 21, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
Co-authored-by: Will@Cambridge <[email protected]>
Co-authored-by: Will@Cambridge <[email protected]>
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
androidand pushed a commit to androidand/opencode-skein that referenced this pull request Sep 19, 2026
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.

[FEATURE]: Add keybind to navigate between user messages

4 participants