Skip to content

fix(linux): reveal chat shortcut hints on the primary modifier - #254

Merged
sambitcreate merged 2 commits into
mainfrom
fix/linux-chat-shortcut-reveal
Sep 26, 2026
Merged

sambitcreate merged 2 commits into
mainfrom
fix/linux-chat-shortcut-reveal

Conversation

@sambitcreate

Copy link
Copy Markdown
Owner

Summary

  • Linux x64 CI now fails on every PR. feat: type-to-focus composer and Command-hold chat shortcut hints #128's hold-to-reveal test expects ⌘1, but after feat(linux): bring desktop support up to date #71 landed the Linux runner shows Ctrl+1.
  • The mismatch is also a real bug. Chat-jump accelerators store the primary modifier as Command, which acceleratorFromKeyboardEvent matches against Ctrl outside macOS. The reveal hook, however, always watched Meta. So on Linux, holding Super showed Ctrl+N hints and holding Ctrl showed nothing.
  • chatShortcutRevealModifierSets now maps modifiers per platform: Command→Ctrl and Control→Super outside macOS, with macOS behaviour unchanged. The e2e test now uses the platform's primary modifier and hint label.

Tests

  • renderer/lib/sidebar-chat-shortcuts.test.ts: the existing mapping test is pinned to macOS, and a new test covers the Linux mapping. 7 of 7 pass.
  • tests/e2e/chat-shell-interactions.spec.ts now uses PRIMARY_MODIFIER. It will be verified by Linux x64 CI on this PR.

🤖 Generated with Claude Code

Chat-jump accelerators store the primary modifier as Command, which
matches Ctrl outside macOS, but the held-modifier reveal always watched
Meta. On Linux, holding Super showed Ctrl+N hints and holding Ctrl
showed nothing. Map reveal modifiers per platform the same way
acceleratorFromKeyboardEvent does, and drive the e2e test with the
platform's primary modifier.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAkZRgQzUoKWGpgupF3a4D

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes This review covers platform-specific keyboard-event mapping for chat shortcut hint reveal and its unit/e2e coverage.

  • Modifier mapping: Command and Control now map to the corresponding DOM event modifiers per platform, aligning hint reveal with shortcut dispatch.
  • Shortcut coverage: Unit tests preserve macOS behavior and verify Linux mapping; the e2e test checks reveal, release, and activation using the platform primary modifier.

The focused sidebar suite (45 tests) and type-check:e2e pass. Electron e2e execution remains for macOS CI.

Pullfrog  | View workflow run | Using GPT Luna | 𝕏

@very-hermes-bot

Copy link
Copy Markdown
Collaborator

Hermes Review Bot

Confidence: 5

Engine: agy/gemini-3.8-flash-high
Review mode: small
Head: ea0d8291e83d86675d187531e72a3c1016532f5f
Generated: 2026-09-26T10:44:12+00:00
Reviews: 1

Summary

Resolves a platform mismatch on Linux where holding the primary shortcut modifier failed to reveal chat jump badges, and fixes the resulting Linux x64 CI failure. The hold-to-reveal modifier resolver now maps canonical accelerators to keyboard event modifiers by platform, translating Command to Control and Control to Meta outside macOS to mirror acceleratorFromKeyboardEvent. The unit test suite adds explicit Linux modifier coverage, and the Playwright e2e test now exercises the dynamic primary modifier key and hint label prefix across macOS and Linux runners. Maintainers should double-check that downstream keyboard layout assumptions on Windows (which resolves as other) intend to share the non-macOS Control/Meta mapping.

Confidence Score: 5/5

Full end-to-end trace completed across sidebar-chat-shortcuts.ts, chat-sidebar.tsx, use-held-modifier-reveal.ts, and keybindings.ts, confirming complete inverse parity between event modifier detection, accelerator execution, pretty-printing, and accessibility labels.

📁 Important Files Changed
  • renderer/lib/sidebar-chat-shortcuts.ts: Replaced the static ACCELERATOR_TO_EVENT_MODIFIER lookup with eventModifierForAcceleratorPart, dynamically resolving event modifiers per KeyboardPlatform (Command → Control and Control → Meta outside macOS).
  • renderer/lib/sidebar-chat-shortcuts.test.ts: Explicitly pinned the existing modifier test to "darwin" and added a test verifying the "linux" modifier mappings.
  • tests/e2e/chat-shell-interactions.spec.ts: Swapped hardcoded Meta down/up/press events and ⌘ string assertions for PRIMARY_MODIFIER and dynamic hintPrefix resolution (⌘ on macOS, Ctrl+ on Linux).

Findings

No findings.

📊 Sequence Diagram

Unchanged or not applicable for this change.

Machine-Readable Findings

[]

Last reviewed commit: ea0d8291e83d
Reviews (1) · Comment /hermes review to trigger a new review · /hermes review full for full re-review

@sambitcreate
sambitcreate merged commit a13605a into main Sep 26, 2026
3 of 5 checks passed
sambitcreate added a commit that referenced this pull request Sep 26, 2026
…eature/gemini-3-8-tts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAkZRgQzUoKWGpgupF3a4D
sambitcreate added a commit that referenced this pull request Sep 26, 2026
…lone

Keeps both sides:
- vision-analysis-tool: the PR's wrapper plus main's normalizeContext in the core.
- package.json: test scripts are the union of both sides (test:compaction
  gains memory-shared; the PR's test:cli wiring is kept).

Aligns the standalone CLI with root pi 0.87.1 (#246):
- Bump packages/cli @earendil-works/pi-coding-agent 0.84.4 -> 0.87.1 and add
  @earendil-works/chord 0.87.1, which is no longer hoisted.
- btw wraps its context in normalizeContext. The child beforeTool context
  drops systemPrompt. Re-vendor the advisor runtime.
- The build's external check falls back to ESM resolution for import-only
  subpath exports, and allowlists the optional lazy kerberos import.
- Session import accepts storage-v1 `v: 4` and 0.84.4 `version: 4` headers.
- Commit the CLI themes regenerated for #199's new presets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAkZRgQzUoKWGpgupF3a4D
sambitcreate added a commit that referenced this pull request Sep 26, 2026
aea8f1d merged main only through #254. This side already contains that
plus #199 and #246, so the resulting tree is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAkZRgQzUoKWGpgupF3a4D
sambitcreate added a commit that referenced this pull request Sep 26, 2026
Main landed #246 (pi 0.87.1 transcript-owned system prompts), #242, #199
and #254.

- pi-agent-runtime-harness: keep main's installCompactedMessages and emit
  the meter projection from the installed (system-preserving) messages
  after preflight and per-turn compaction.
- agents-instructions: withAgentsInstructionsEstimate builds a one-message
  transcript, applies the section-patching refresher and reads
  getCurrentSystemPrompt; the block stripper also handles a block rendered
  without a base prompt.
- llm-client: register the generation context profile after the initial
  AGENTS.md apply so the captured prompt and tracker baseline agree.
- agents-instructions.test: union of both import sets; meter tests use
  AgentContext transcripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAkZRgQzUoKWGpgupF3a4D
sambitcreate added a commit that referenced this pull request Sep 26, 2026
…go midflight ops

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAkZRgQzUoKWGpgupF3a4D
@sambitcreate
sambitcreate deleted the fix/linux-chat-shortcut-reveal branch September 26, 2026 17:53
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