Skip to content

fix: Grok-safe quick wins (tokens, a11y, perf, gates) - #1651

Merged
BigSimmo merged 19 commits into
mainfrom
cursor/grok-quick-wins-a2c0
Aug 7, 2026
Merged

fix: Grok-safe quick wins (tokens, a11y, perf, gates)#1651
BigSimmo merged 19 commits into
mainfrom
cursor/grok-quick-wins-a2c0

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

Isolated worktree off current origin/main (cursor/grok-quick-wins-a2c0) so this does not touch other active hot branches.

Verification

  • Focused unit tests: npm run test -- tests/use-hide-on-scroll.test.ts tests/use-viewer-gestures.dom.test.tsx tests/document-frame.dom.test.tsx38 passed
  • npm run typecheck → exit 0 (now source-only config)
  • npm run check:outstanding-issues → exit 0 (112 open, 141 archived)
  • npm run verify:pr-local -- --dry-run --files … plan inspected
  • Verification not run: full npm run verify:pr-local (includes build + full unit suite) — recommend CI / local handoff
  • UI verification not run: npm run verify:phone-chrome for #176 — focused unit coverage added; phone-chrome gate still recommended before merge

Risk and rollout

  • Risk: Low. No RAG/ranking, no provider calls. Phone-chrome ordering and document-viewer wheel passive flag are the behaviour-sensitive bits; both have focused tests.
  • Rollback: Revert the two commits on this branch.
  • Provider or production effects: None

Notes

  • Worktree: /home/ubuntu/wt-grok-quick-wins (does not switch /workspace)
  • Branch base was behind 0 vs origin/main at start (c839b97d)
Open in WebOpen in Cursor

Summary by CodeRabbit

  • Bug Fixes

    • Improved scroll-based navigation so interface controls reliably reappear near the top of newly selected content.
    • Prevented unintended browser page zoom during Ctrl/⌘ wheel gestures and trackpad pinch actions within document viewing.
    • Removed an unused medication accent style.
    • Resolved and archived completed issue records while keeping execution queues current.
  • Documentation

    • Updated chip sizing guidance and review records.
    • Expanded outstanding-issue tracking with corrected queue ordering and resolution history.
  • Chores

    • Improved validation for issue queues and internal type checking.

- Drop unused --med-accent-soft (#157)
- Document Chip compact=11px / standard=12px (#220)
- Reveal phone chrome on source change at top (#176)
- Passive wheel listener for modifier-gated PDF zoom (#214)
- Point npm run typecheck at source-only tsconfig (#210)
- Fail outstanding-issues when queue cites non-open IDs (#201)
Also confirms MatchExplanationChips, Favourites empty-state,
DocumentFrame role=alert, and refetching dimming claim are
already resolved on main (#223/#225/#219/#246).
#225#246
Prune them from the recommended queue so the new queue-membership gate stays green.
@coderabbitai

coderabbitaiBot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in:28 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bdcbfdc4-ae77-489e-894d-90a954a73d1f

📥 Commits

Reviewing files that changed from the base of the PR and between 9b47852 and 4655643.

📒 Files selected for processing (1)
  • docs/branch-review-ledger.md
📝 Walkthrough

Walkthrough

Changes

Issue queue lifecycle

Layer / File(s)Summary
Queue parsing and validation
scripts/check-outstanding-issues.mjs
The checker parses the recommended queue separately and validates each cited ID against the open-items table. Self-tests cover malformed rows, formatting, separators, and archived citations.
Resolution and queue pruning
scripts/outstanding-issues.mjs
pruneResolvedIdFromQueue removes resolved IDs, preserves composite rows, deletes empty rows, and renumbers remaining entries before archival.
Issue ledger updates
docs/outstanding-issues.md
The queue, open-items table, and archive reflect reordered work and resolved issue records.

Interaction behavior

Layer / File(s)Summary
Scroll-source reveal behavior
src/components/clinical-dashboard/use-hide-on-scroll.ts, tests/use-hide-on-scroll.test.ts
Top-band offsets reveal chrome during source changes. Other source changes rebase the scroll baseline while preserving visibility state.
Wheel gesture handling
src/components/document-viewer/use-viewer-gestures.ts, tests/use-viewer-gestures.dom.test.tsx
Plain wheel events retain native scrolling. Cancelable modifier-gated zoom events call preventDefault(). Tests verify non-passive listeners and browser-zoom suppression.

Documentation and styling cleanup

Layer / File(s)Summary
Review records and typecheck configuration
docs/branch-review-ledger.md, package.json
Review records were corrected or added. The internal typecheck script now uses tsconfig.typecheck.json.
Token and medication styling documentation
docs/design-system/TOKENS.md, src/app/globals.css, src/components/clinical-dashboard/medication-record-page.tsx
Chip token mappings were documented. The unused medication soft-accent variable was removed.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
participant resolveIssue
participant pruneResolvedIdFromQueue
participant outstandingIssuesMarkdown
participant checkIssues
resolveIssue->>pruneResolvedIdFromQueue: remove resolved issue ID
pruneResolvedIdFromQueue->>outstandingIssuesMarkdown: update queue and renumber rows
resolveIssue->>outstandingIssuesMarkdown: archive resolved issue
checkIssues->>outstandingIssuesMarkdown: parse queue citations
checkIssues-->>resolveIssue: validate current open issue IDs
Loading

Possibly related PRs

Suggested labels:javascript

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 30.77% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the focused token, performance, and validation changes in the pull request.
Description check✅ PassedThe description covers the changed issues, verification results, skipped gates with reasons, risk, rollback, and production effects.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/grok-quick-wins-a2c0

Comment @coderabbitai help to get the list of available commands.

@supabase

supabaseBot commented Aug 6, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review August 6, 2026 16:38
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

sentry[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

- Keep viewer wheel listener non-passive while wheelZoom is on and
preventDefault on Ctrl/⌘+wheel / trackpad pinch so PDF zoom does not
also zoom the browser page (Sentry/Devin).
- Prune recommended-queue ID citations in resolveIssue so issues:done
stays writable under the #201 gate.
- Drop restated Chip pixel values from TOKENS.md; amend #214 archive note.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

cursoragentand others added 2 commits August 6, 2026 16:56
Devin: pruneResolvedIdFromQueue used a pre-splice openStart for
renumbering, so enough solo-queue deletions could rewrite Open items
headers/ids. Recompute the section limit after edits and cover it in
the writer self-test.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo enabled auto-merge (squash) August 6, 2026 17:24
@cursor

cursorBot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

PR #1651 heavy review-and-fix summary

Tip:1dbde41393b1335b2fff34b56adf69338fa95c4e on cursor/grok-quick-wins-a2c0
Base:main @ c839b97d · ahead 5 / behind 0 · merge-tree clean · MERGEABLE
Auto-merge: armed (squash) by @BigSimmono push from this pass (would cancel queued required CI; no code blocker to clear).

Review

  • Bugbot: no bugs
  • Security review: no medium+ findings
  • Manual delta review: no new high-confidence P0–P2 on this tip
  • Prior Sentry/Devin threads (double-zoom, issues:done queue prune, TOKENS px restatement, Order-boundary renumber) already fixed in 38b7f8e4 / 5d625d3e and resolved (0 unresolved actionable threads)
  • Fixed vs dispositioned this pass: none new (clean tip)

Sync / merge-tree

  • No sync needed (behind 0, merge-tree clean vs origin/main)
  • Labels: none blocking

Required CI (this tip)

  • Required checks still queued awaiting runners (org backlog observed ≈50 queued / 0 in_progress) — not green yet, not failed
  • Advisory: Devin Review pass; GitGuardian pass
  • Missing/pending while queued ≠ green; merge left blocked until runners pick up Change scope / pr-required aggregate

Local offline gates (decisive lines)

  • vitestuse-hide-on-scroll + use-viewer-gestures: Tests 35 passed (35)
  • check:outstanding-issues (+ writer self-test): Outstanding-issues guard passed: 253 rows (112 open, 141 archived) / writer self-test passed
  • npm run verify:cheap: Test Files 515 passed (515) / Tests 5450 passed | 1 skipped
  • npm run verify:pr-local: exit 0 (format + typecheck via tsconfig.typecheck.json + full unit + build + Offline RAG fixture and manifest validation passed (36 golden cases, 23 suites))
  • npm run verify:phone-chrome: exit 0 — focused phone journeys 13 passed; full verify:ui364 passed (8.5m)

Residual risks

  • Hosted required CI still waiting on Actions runners (not a product defect on this tip)
  • Physical Safari / installed-PWA acceptance still outside Chromium phone-chrome proof
  • Ledger row for this heavy review is local-only / unpushed (no-change tip; will not push a ledger-only commit while auto-merge is armed)

Merge left to you.

cursoragentand others added 5 commits August 6, 2026 23:37
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>

@coderabbitaicoderabbitaiBot 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.

Actionable comments posted: 3

🧹 Nitpick comments (1)
tests/use-viewer-gestures.dom.test.tsx (1)

68-84: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the remaining wheel-event branches.

This test uses only ctrlKey: true and cancelable: true. Add a metaKey: true case and a non-cancelable modifier-wheel case. Assert event.defaultPrevented for the cancelable case and verify the intended behavior when cancellation is unavailable.

Suggested assertion
 expect(onZoomBy).toHaveBeenCalledTimes(1);
expect(preventDefault).toHaveBeenCalled();
+ expect(event.defaultPrevented).toBe(true);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/use-viewer-gestures.dom.test.tsx` around lines 68 - 84, Extend the
wheel gesture tests around GestureHarness to cover modifier-wheel events with
metaKey: true and with cancelable: false, in addition to the existing ctrlKey
case. For the cancelable event, assert event.defaultPrevented is true; for the
non-cancelable event, verify the intended zoom behavior and that cancellation
cannot be applied without requiring preventDefault to succeed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/branch-review-ledger.md`:
- Around line 675-685: Restore both distinct PR `#1641` ledger records removed by
merge commit b2ab472986ed5d1a1d9df6795a66ee687ce6df33, keeping the existing PR
`#1651` records intact. Apply ledger:dedupe only to exact duplicate rows and do
not remove records that differ in branch, commit, or details.
In `@docs/design-system/TOKENS.md`:
- Line 51: Update the “Chip sizes” row in TOKENS.md so the `--text-2xs` mapping
for `Chip compact` is explicitly marked as a legacy compatibility token, while
retaining the v2 `--text-xs` default mapping and existing guidance.
In `@docs/outstanding-issues.md`:
- Around line 159-160: Update queue item `#250` in the outstanding-issues ledger
to remove the resolved `#201` reference from its action text and replace it with
the remaining open work, including matching updates to the related open-item
wording. Keep `#202` actionable and ensure no stale `#201` reference remains in the
item.
---
Nitpick comments:
In `@tests/use-viewer-gestures.dom.test.tsx`:
- Around line 68-84: Extend the wheel gesture tests around GestureHarness to
cover modifier-wheel events with metaKey: true and with cancelable: false, in
addition to the existing ctrlKey case. For the cancelable event, assert
event.defaultPrevented is true; for the non-cancelable event, verify the
intended zoom behavior and that cancellation cannot be applied without requiring
preventDefault to succeed.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1f403c2d-3362-4a74-bd94-a0d74c7d1413

📥 Commits

Reviewing files that changed from the base of the PR and between 7d3e626 and b2ab472.

📒 Files selected for processing (12)
  • docs/branch-review-ledger.md
  • docs/design-system/TOKENS.md
  • docs/outstanding-issues.md
  • package.json
  • scripts/check-outstanding-issues.mjs
  • scripts/outstanding-issues.mjs
  • src/app/globals.css
  • src/components/clinical-dashboard/medication-record-page.tsx
  • src/components/clinical-dashboard/use-hide-on-scroll.ts
  • src/components/document-viewer/use-viewer-gestures.ts
  • tests/use-hide-on-scroll.test.ts
  • tests/use-viewer-gestures.dom.test.tsx

Comment threaddocs/branch-review-ledger.md
Comment threaddocs/design-system/TOKENS.md Outdated
Comment threaddocs/outstanding-issues.md Outdated
cursoragentand others added 7 commits August 7, 2026 01:45
CodeRabbit on #1651: clarify Chip compact uses a legacy compat type
step, and stop pointing the multi-wave queue at resolved#201.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo merged commit 2563b4a into mainAug 7, 2026
24 of 25 checks passed
@BigSimmo
BigSimmo deleted the cursor/grok-quick-wins-a2c0 branch August 7, 2026 03:49
cursorBot pushed a commit that referenced this pull request Aug 7, 2026
Resolve outstanding-issues by taking main and re-queueing #256/#257.
Take main's non-passive wheel listener (Sentry double-zoom fix) over the
branch's promote-to-blocking approach.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
cursorBot pushed a commit that referenced this pull request Aug 7, 2026
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
cursorBot pushed a commit that referenced this pull request Aug 7, 2026
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Sign up for freeto 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

@BigSimmo@cursoragent