The shortcut chip is desktop-only - #16
Merged
Merged
Conversation
`showShortcut` had no viewport guard, so the ⌘K / Ctrl-K chip rendered at rest on phones — advertising a keyboard shortcut to a device with no keyboard, and charging ~55px of the input's visible width for it. That width is not cosmetic. An expert-panel round on a consumer measured the at-rest text budget on a 390px screen at ~169px with the chip present; the site's placeholder rendered as "Ask how the model w", clipped mid-word with its second clause gone entirely. The chip was ~55px of that shortfall. `isMac` compounds it: it reads navigator.platform, so a touch device can render the wrong modifier for a shortcut it cannot press either way. Guarded on the same 767px breakpoint the footer-collision check already uses, as state set from an effect rather than derived inline from matchMedia — the inline form hydrate-mismatches, which is why isMac is shaped this way too. The listener keeps it correct across rotation. Three tests: shown wide, hidden narrow, and the property that motivated it — the same bar yields a wider field once the chip is gone. Dropping the guard fails two of them. Suite 45/45 (3 new) · typecheck clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
showShortcuthad no viewport guard, so the⌘K/Ctrl Kchip rendered at rest on phones — advertising a keyboard shortcut to a device with no keyboard, and charging ~55px of the input's visible width for it.That width is not cosmetic
An expert-panel round on a consumer site measured the at-rest text budget on a 390px screen at ~169px with the chip present. The site's placeholder rendered as:
Clipped mid-word, second clause gone entirely. The chip was ~55px of that shortfall.
isMaccompounds it — it readsnavigator.platform, so a touch device can render the wrong modifier for a shortcut it cannot press either way.The fix
Guarded on the same 767px breakpoint the footer-collision check already uses, so the two agree about what "mobile" means.
Held as state set from an effect, not derived inline from
matchMedia— the inline form hydrate-mismatches (server sees nowindow, renders the chip; client hides it). That is exactly whyisMacis shaped this way, and the new state follows it. Achangelistener keeps it correct across rotation.Tests
Mutation: dropping
&& !isNarrowfails 2 of 3.Suite 45/45 (3 new) · typecheck clean · version 1.4.1 → 1.4.2.
Publishing is tag-triggered, so merging this does not release it.
🤖 Generated with Claude Code