Skip to content

feat(chat): add a configurable shortcut for quoting selected text - #4664

Merged
devswha merged 13 commits into
devswha:mainfrom
odfalik:feat/chat-quote-shortcut
Nov 27, 2026
Merged

devswha merged 13 commits into
devswha:mainfrom
odfalik:feat/chat-quote-shortcut

Conversation

@odfalik

@odfalik odfalik commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add Mod+Shift+9 for the existing selected-text Quote action in Chat. The active binding appears in the button's tooltip and the existing shortcut settings.
  • Reuse the existing selection validation, quote formatting, length limit and composer insertion. No message is sent.
  • Leave keys alone in text fields and Terminal mode, or when no eligible visible Chat selection exists.

Verification

  • 42 shortcut and quote tests passed; typecheck and production build passed with the repository's unchanged frozen lockfile.
  • Real compiled app against an isolated herdr session and native Pi with a persisted public-example conversation. Trusted mouse selection and keyboard input appended the same quote as the existing button, preserving the original draft. No Chat submit or external provider request occurred during the interactions.
  • Trusted composer and Terminal key presses left the draft unchanged and were not prevented. The shortcut was visible in existing Settings.
Real-app interaction Result
Mouse-selected Chat text → Mod+Shift+9 Original draft retained, one formatted quote appended; selection cleared.
Same selection → existing Quote button Exact same draft/quote bytes as the hotkey.
Mod+Shift+9 while editing the composer Draft unchanged; defaultPrevented: false.
Mod+Shift+9 in Terminal, then return to Chat Draft unchanged; defaultPrevented: false.
Chat submit frames during these interactions 0.
  • Screenshots below show the real app with public test text. No customer transcript, credentials or machine metadata is included. No mocked Quote UI or screenshot harness is committed.

Evidence

Selected text and the existing Quote action:

Selected public Chat text and the existing Quote action

Draft preserved after the keyboard Quote action:

Original draft retained after the keyboard Quote action

Discoverable binding in existing shortcut settings:

Configurable Quote shortcut in existing Settings

Terminal remains a separate, non-quoting key context:

Terminal mode after the key press, without a Chat Quote action

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: devswha/ovis
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 880fdcb
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a9ce686f-e32f-4b23-9881-e1382d22e35a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added a configurable keyboard shortcut to quote selected chat text into the current message. The default is Mod+Shift+9, and the Quote button tooltip displays the configured shortcut.
    • Quoting text does not send the message. The shortcut is ignored in text fields and Terminal mode.

This change adds a configurable Mod+Shift+9 shortcut for quoting selected chat text. The shortcut appears in the Quote button title and triggers the existing quote action when the event and selection offer pass validation.

Changes: Chat quote shortcut

Layer / File(s) Summary
Register and test the shortcut
src/lib/shortcuts.ts, src/lib/shortcuts.test.ts
Adds the default quote-chat binding and excludes it from app-level shortcut dispatch. Tests cover platform matching, display, conflicts, disabling, and rebinding.
Handle the shortcut in chat replies
src/components/ReplyComments.tsx, changelog.d/chat-quote-shortcut.md
Displays the configured shortcut in the Quote button title. The keydown handler invokes the existing quote action only when its event and offer checks pass. The changelog describes the shortcut and contexts where it does not act.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related PRs

  • devswha/ovis#2577: Changes selection validation and quote formatting used by the shortcut’s existing Quote action.
  • devswha/ovis#2574: Introduces the chat-reply Quote action that this shortcut invokes.
  • devswha/ovis#1922: Removes the chat-reply Quote action that this shortcut invokes.

Suggested reviewers: devswha

Merge Risk: Minimal · previous review 63495

This adds a configurable Mod+Shift+9 shortcut that invokes the existing Chat quote action without sending a message. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a configurable keyboard shortcut for quoting selected text in Chat. It matches the changeset, which adds a Mod+Shift+9 binding for the existing Quote action. It is spe…
Description check Passed The description covers the change, the behavior, and extensive validation. It explains the shortcut, the reuse of existing selection and insertion logic, the non-send behavior, and the exclusions for …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a configurable keyboard shortcut for quoting selected text in Chat. It matches the changeset, which adds a Mod+Shift+9 binding for the existing Quote action. It is specific and follows conventional commit style.

Full details: Description check

Explanation

The description covers the change, the behavior, and extensive validation. It explains the shortcut, the reuse of existing selection and insertion logic, the non-send behavior, and the exclusions for text fields and Terminal mode. The Validation section lists the tests and build run, plus real-app checks. It does not name the repository's standard checks (bun run check fast or full), and it does not link an issue as the template asks for features. It also does not state whether contract tests apply, though no HTTP/WS change is described.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: devswha/ovis
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: d122cc0
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b8aa5fca-48b4-4cc4-afd2-aaf1fc098f11
Commits

Reviewing files that changed from the base of the PR and between d122cc0 and 6349593.

Files selected for processing: 4

  • changelog.d/chat-quote-shortcut.md
  • src/components/ReplyComments.tsx
  • src/lib/shortcuts.test.ts
  • src/lib/shortcuts.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@devswha
devswha merged commit dd8050d into devswha:main Nov 27, 2026
27 of 29 checks passed
@devswha

devswha commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Merged through pr-merge at head 081c24988. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit said it did not review (a limit or a skip) since this head.

External feature PR; maintainer go in the Dori session 2026-11-26; reviews: omo gate + Codex adversarial (gpt-6.2-sol-fast xhigh), one each; maintainer edits: added quote-chat to the Settings sanitizer allowlist so it can be rebound or turned off, kept an existing custom binding on Mod+Shift+9 ahead of the new default (Quote then shows as unbound in Settings and the tooltip), moved the shared label's ja/ko/zh translations to base, dropped the wrong terminal warning for Quote; merged latest main. Earlier CI failures (winvm-runner timing test, ui-access-regression timeout, chat-fallback telemetry ENOENT) are outside this change.

@devswha

devswha commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Thanks @odfalik, this is merged. A few maintainer edits on top of your branch:

  • quote-chat was missing from the Settings allowlist, so rebinding or turning off Quote in Settings had no effect. It is in now, with a test through the Settings path.
  • If someone already bound another action to Mod+Shift+9, that binding keeps working and Quote shows as unbound in Settings and the tooltip, instead of advertising a chord that does something else.
  • The shared label's ja/ko/zh translations moved to the base dictionaries (the i18n ownership test), and Settings no longer warns that a Quote binding stops reaching the terminal.
  • The chat fallback browser lab now answers /api/telemetry with a 404, since the shortcut module loads the usage counters there.

devswha added a commit that referenced this pull request Nov 27, 2026
…4886)

Fork pull requests run **Fast checks** on GitHub's `ubuntu-24.04` image
(they never reach the self-hosted pool). There it takes 9 to 10 minutes,
so about half the runs hit the 10-minute `timeout-minutes` and were
cancelled, and the merge gate then refused the PR (#4664 three times).

This raises that one job's limit from 10 to 15 minutes:
- `.github/workflows/ci.yml`: `fast` job.
- `.github/workflows/release-validate.yml`: its `Fast checks
(GitHub-hosted)` copy, which `scripts/release-validate-workflow.test.ts`
requires to match ci.yml's.

No other job, runner routing, trigger, permission or secret changes.
Fork PRs stay on GitHub-hosted runners.

Verification: `bun run check fast` passed locally (workflow syntax via
actionlint, typecheck, build, unit tests 29194 pass / 0 fail); the
workflow tests (`release-validate-workflow`, `light-runner-workflow`,
`pages-gate`, `release-ci-reuse`) pass.

Workflow change (timeout only) approved by the maintainer.
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.

2 participants