Skip to content

fix(web): give note-row and notebook-row actions a 44 px touch target - #915

Open
JakubAnderwald wants to merge 4 commits into
mainfrom
factory/issue-899
Open

JakubAnderwald wants to merge 4 commits into
mainfrom
factory/issue-899

Conversation

@JakubAnderwald

Copy link
Copy Markdown
Owner

Closes #899

Summary

On a touch-only pointer (@media (hover: none)), the note-row ⋮ and the notebook-row × are now 44×44 px tap targets, with their icons kept at their old size. Hover-capable pointers get no class change, so desktop is unchanged. This implements the approved plan, plus one fix the plan missed (see Drift).

  • Note row ⋮: on touch, top-0 right-0 h-11 w-11 (the icon's centre stays 22 px from the row's top and right edges). The row button adds [@media(hover:none)]:pr-12 to its pr-10, so the title's box ends 4 px before the target. The 54 px row holds the 44 px target, so neighbouring targets are 10 px apart.
  • Notebook ×: on touch, inline-flex items-center justify-center h-11 w-11 shrink-0. The row gets py-0 pr-0, so it is exactly 44 px tall and the target ends at its right edge. shrink-0 stops a long name from narrowing the button.

Parity report

  • web — apps/web/src/components/notes/note-list.tsx, apps/web/src/components/notebooks/notebooks-sidebar.tsx ✅
  • mobile / desktop — out of scope per the spec (their row actions are separate native code).

Test plan

  • pnpm --filter @drafto/web test: 2158 passed, 2 skipped
  • pnpm --filter @drafto/web typecheck: passed
  • pnpm --filter @drafto/web lint: 0 errors. The 22 warnings were already there; the one in notebooks-sidebar.tsx is at line 78, which this PR doesn't touch.
  • pnpm format:check: passed
  • Web Playwright, full suite (pnpm test:e2e, all projects): 153 passed, 18 skipped (viewport-gated describes), 0 failed. The chromium fix(web): keep long note titles clear of the hover actions button on desktop #900 test now also asserts the ⋮ is still 28×28 with a mouse.
  • Touch tests (responsive.spec.ts → touch row actions) re-run after the final change on Mobile Chrome, Mobile Safari and Tablet: 15 passed, 0 skipped. This settles the plan's open question: WebKit's iPhone 13 and iPad projects do match (hover: none), so the new 44 px checks run on all three touch projects.
  • Not applicable: pnpm migration:check (no schema change).

Drift vs. approved plan

  • Menu position on touch (note-list.tsx). The plan kept the note menu at top-8. A local review found that this puts the menu (z-10) over the lower 8 px of the new 44 px ⋮, and that strip is the Delete item, which trashes the note without asking. So a second tap on the ⋮ to close the menu could delete the note. On touch the menu now opens at [@media(hover:none)]:top-11, below the target. Desktop keeps top-8. The integration test checks both classes, and the touch E2E checks that the open menu starts below the ⋮'s box.
  • apps/web/e2e/helpers/e2e-patterns.ts (not in the plan): the new notebook test names its notebook Touch Target NB With A Name Long Enough To Truncate In The Sidebar <timestamp>. The prefix is added to E2E_NAME_PREFIXES, as docs/architecture/testing.md → "E2E data hygiene" requires; e2e-cleanup-patterns.test.ts fails without it.
  • E2E robustness: the touch tests read every bounding box they compare in a single evaluateAll, and the note-row one retries through the list's post-create refetch (toPass). Other workers sign in as the same E2E user and add rows to the same lists, so separate boundingBox() calls could see rows shift in between. The note-row test also checks that the long new notebook name really truncates, so the shrink-0 case isn't vacuous.
  • Everything else matches the plan's "Files to touch", including the narrowed fix(web): keep long note titles clear of the hover actions button on desktop #909 assertion in note-list.test.tsx. Hover, focus and group-* pr- variants stay forbidden, and the only allowed media-query padding is [@media(hover:none)]:pr-12.

🤖 Generated by the dark factory (approved plan)

🤖 Generated with Claude Code

On a touch-only pointer (`@media (hover: none)`) the note-row ⋮ grows from
28 px to a 44 px button anchored to the row's top-right corner, so its icon
stays where it was, and the row reserves 48 px for it so the title still
truncates before it. Its menu opens below the 44 px target, so a second tap
on the ⋮ can't land on Delete. The notebook × becomes a 44 px centred,
non-shrinking button and its row drops its vertical and right padding, so
rows are 44 px tall and neighbouring targets can't overlap. Hover-capable
pointers get no class change.

Playwright checks the boxes on the touch projects (Mobile Chrome, Mobile
Safari, Tablet), and the desktop #900 test checks the ⋮ is still 28 px.

Closes #899

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
drafto Ready Ready Preview Dec 1, 2026 12:04am UTC

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b466810 and 3635fae.

Files selected for processing: 8

  • apps/web/__tests__/integration/note-list.test.tsx
  • apps/web/__tests__/integration/notebooks-sidebar.test.tsx
  • apps/web/e2e/helpers/e2e-patterns.ts
  • apps/web/e2e/notes.spec.ts
  • apps/web/e2e/responsive.spec.ts
  • apps/web/src/components/notebooks/notebooks-sidebar.tsx
  • apps/web/src/components/notes/note-list.tsx
  • docs/features/notes-and-notebooks.md
  • 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

@JakubAnderwald

Copy link
Copy Markdown
Owner Author

Factory code review

No findings. The change does what the approved plan describes, and the one place it departs from the plan is a justified fix.

  • Blocking: 0
  • Should fix: 0
  • Nits: 0

Checked against main:

  • Cascade: cn is plain clsx (no tailwind-merge), so the base classes and the [@media(hover:none)]: overrides both reach the DOM. Tailwind v4 emits the media-variant rules after the base utilities, so on touch h-11/w-11/top-0/right-0/pr-12 beat h-7/w-7/top-2/right-2/pr-10. pr-0 beats px-2, a logical-vs-physical pair that the cascade resolves by order. The new E2E checks would fail if any of these lost: the title edge with pr-10, and 28 px against 44 px.
  • Geometry: the note row is 54 px (py-2 + 20 + 2 + 16), so the 44 px ⋮ at top-0 stays inside its li, and the icon centre stays 22 px from the top and right edges. On touch the notebook row is 44 px with py-0. With the space-y-0.5 gap, targets in neighbouring rows can't overlap.
  • Hover: Tailwind v4 wraps hover: in @media (hover: hover), so the ghost hover:bg-bg-muted on the bigger ⋮ and the ×'s hover:text-error don't stick after a tap on touch devices.
  • Menu top-11 drift: this is outside the plan, but the PR body documents it and it is correct. With top-8, the z-10 menu would cover the bottom of the 44 px target. The E2E check menuBox.y >= actions bottom isn't flaky either: dropdown-in scales from 0.95 around the centre, which only pushes the box's top edge down.
  • E2E hygiene: the new notebook name is 80 characters (limit 100) and matches the new E2E_NAME_PREFIXES entry plus a 13-digit timestamp.
  • Scope: web only, per the spec. The docs bullet in notes-and-notebooks.md matches the implementation.

Comment thread apps/web/e2e/notes.spec.ts Resolved
@JakubAnderwald

Copy link
Copy Markdown
Owner Author

CodeRabbit CLI review — eff7c3550eec

The CodeRabbit PR bot did not review this commit, so the factory ran the CodeRabbit CLI on the full PR diff at eff7c3550eec (base 0701d5545516). Outcome: ok.

Opened 1 inline thread.

Automated, unverified vendor findings (CodeRabbit CLI, posted by the Drafto factory).

# Conflicts:
#	docs/features/notes-and-notebooks.md
@JakubAnderwald

Copy link
Copy Markdown
Owner Author

Factory watcher: blocked on an outside-service failure, not the code. SonarCloud run 45171156594 failed before analysing anything (ERROR Something went wrong while trying to get the pullrequest with key '915': Illegal base64 character 2d). The factory only re-runs cancelled or timed-out checks, so no fix pass can clear it. The PR's quality gate reports OK (coverage 100%, 0 issues), and the same scan passed on eff7c35. To unblock: gh run rerun 45171156594 --failed, then return the card to In Review.

Main (#921) put a note-count badge between the notebook name and its delete
button, so the button's previous sibling is now the count, not the name, and
the long-name truncation check read the wrong span.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JakubAnderwald

Copy link
Copy Markdown
Owner Author

Factory code review

No findings. The change does what the approved plan asks, and the one way it departs from the plan is justified and written up in the PR description.

  • Blocking: 0
  • Should fix: 0
  • Nits: 0

Reviewed at 3635fae, all 8 files:

  • Layout. cn is plain clsx with no tailwind-merge, so the [@media(hover:none)]: size, position and padding classes sit alongside IconButton's h-7 w-7 and the base top-2 right-2 / pr-10 / px-2 py-1.5. They win only through CSS order, the same way the existing [@media(hover:none)]:opacity-100 already overrides opacity-0.
    • The note row is 54 px tall, so the 44 px target at top-0 right-0 stays inside it. The next row's target starts 12 px lower.
    • With pr-12, the title ends 4 px before the target.
    • On a pointer that can hover, the ⋮'s icon centre is still 22 px from the row's top and right edges.
    • A notebook row on touch is as tall as its 44 px ×, and shrink-0 keeps a long name from narrowing the ×.
  • Drift: menu at [@media(hover:none)]:top-11. The plan said top-8 wouldn't change. With top-8, the open menu (z-10) would cover the bottom 12 px of the 44 px target, and the first item there is Delete. Opening the menu below the target fixes that. Desktop keeps top-8, and the docs and both test layers cover the change. I'm not opening a thread for it.
  • Tests.
    • The narrowed fix(web): keep long note titles clear of the hover actions button on desktop #909 regex still forbids hover, focus and group-* pr- variants, and it now allows exactly one media-query padding.
    • The new touch E2E tests read every box they compare in a single evaluateAll.
    • The tap at {x: 4, y: 4} tells the old 28 px button from the new 44 px one, so it is a real check.
    • The dropdown-in animation only scales the menu around its centre, so the check that the menu starts below the target can't flake low.
    • The notebook name prefix is in E2E_NAME_PREFIXES, and the 80-character name fits under MAX_NOTEBOOK_NAME_LENGTH (100).
  • Docs. docs/features/notes-and-notebooks.md is updated, and nothing else in docs/ or apps/web/src goes stale.
  • No other triggers. There is no privacy, MCP, migration or parity impact (web only, as the spec says).

@JakubAnderwald

Copy link
Copy Markdown
Owner Author

CodeRabbit CLI review — 3635faebaf41

The CodeRabbit PR bot did not review this commit, so the factory ran the CodeRabbit CLI on the full PR diff at 3635faebaf41 (base b466810dfe1d). Outcome: empty.

Opened 0 inline threads.

Automated, unverified vendor findings (CodeRabbit CLI, posted by the Drafto factory).

This branch was successfully deployed

1 active deployment
Preview — 3635faeb Deployed Dec 1, 2026 by vercel[bot]
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.

fix(web): give note-row and notebook-row actions a 44 px touch target

1 participant