Public: anyone can read this; the crew can change it.

small: Review answers to the keys S, D and T on the focused reminder #280

opened this

Merged 25d 21h ago, live in production

Review now answers to S, D and T on the reminder card, and the pull is pushed. The review, a11y, design and security tests pass. I didn't run the whole suite, so the forge's check will be its first full run.

Notes

opened this

Review now answers to S, D and T on the reminder card, and the pull is pushed. The review, a11y, design and security tests pass. I didn't run the whole suite, so the forge's check will be its first full run.

I did not see the script run in a browser. The test checks the markup and the script's text, not the keypress behaviour.

My first push had one red test: it ran after earlier tests had emptied the queue. The second commit fixes that. The Bash tool also reported bun x tsc --noEmit as broken in this clone, and scripts/design-lint.ts doesn't exist here. The repo's lint is scripts/lint-design.ts, and I ran that. tsc printed its help text and checked nothing, because the clone has no tsconfig.json. docs/VISION.md is also missing, so I didn't read it.

What changed

  • static/review.js (new, 618 bytes): it is served with the existing immutable-cached /static/…?v=hash path. The page loads it from the card, because Review's layout turns the shared scripts off.
  • Card focus: the card is focusable and takes focus when the page loads, so the keys work without a click. Keys only fire while focus is inside the card.
  • S, D, T: they call .click() on the real Send, Don't send and Tomorrow buttons. The same server actions and same-origin check run as for a mouse click.
  • Draft box: keys do nothing while focus is in an input, textarea, select or contenteditable element. Ctrl, Meta and Alt combinations and held-down repeats are ignored.
  • src/pages/review.ts: a visible hint line under the heading lists the keys. The card points to it with aria-describedby, and each button carries aria-keyshortcuts.
  • src/review.test.ts: one new test checks the hint, the three data-key buttons, the immutable cache header, the 1 KB limit and the typing guard. It fails without the script or the hint.

What I chose not to do

  • D on an empty reason does not submit. The browser's required-field check focuses the reason box, which is how "opens the reason" works. If a reason is already typed, D submits.
  • T does nothing on a status reminder, because that card has no Tomorrow button.
  • No contract cell is loosened, and there are no new dependencies.

To try it Open /reminders/today. The card is focused, so press S, D or T. Click into the Message box and type those letters to see nothing fire.

🤖 Generated with Claude Code

Closes #272

3 earlier comments
commented

Review now answers to S, D and T on the reminder card, and the pull is pushed. The review, a11y, design and security tests pass. I didn't run the whole suite, so the forge's check will be its first full run.

I did not see the script run in a browser. The test checks the markup and the script's text, not the keypress behaviour.

My first push had one red test: it ran after earlier tests had emptied the queue. The second commit fixes that. The Bash tool also reported bun x tsc --noEmit as broken in this clone, and scripts/design-lint.ts doesn't exist here. The repo's lint is scripts/lint-design.ts, and I ran that. tsc printed its help text and checked nothing, because the clone has no tsconfig.json. docs/VISION.md is also missing, so I didn't read it.

What changed

  • static/review.js (new, 618 bytes): it is served with the existing immutable-cached /static/…?v=hash path. The page loads it from the card, because Review's layout turns the shared scripts off.
  • Card focus: the card is focusable and takes focus when the page loads, so the keys work without a click. Keys only fire while focus is inside the card.
  • S, D, T: they call .click() on the real Send, Don't send and Tomorrow buttons. The same server actions and same-origin check run as for a mouse click.
  • Draft box: keys do nothing while focus is in an input, textarea, select or contenteditable element. Ctrl, Meta and Alt combinations and held-down repeats are ignored.
  • src/pages/review.ts: a visible hint line under the heading lists the keys. The card points to it with aria-describedby, and each button carries aria-keyshortcuts.
  • src/review.test.ts: one new test checks the hint, the three data-key buttons, the immutable cache header, the 1 KB limit and the typing guard. It fails without the script or the hint.

What I chose not to do

  • D on an empty reason does not submit. The browser's required-field check focuses the reason box, which is how "opens the reason" works. If a reason is already typed, D submits.
  • T does nothing on a status reminder, because that card has no Tomorrow button.
  • No contract cell is loosened, and there are no new dependencies.

To try it Open /reminders/today. The card is focused, so press S, D or T. Click into the Message box and type those letters to see nothing fire.

🤖 Generated with Claude Code

commented

I changed nothing and pushed nothing, because I couldn't find a failure my change causes. The log you pasted ends on passing tests, so it doesn't show what failed.

I ran the full suite here: 713 pass, 3 fail. The three failures also fail on a clean checkout of origin/main, so my branch didn't cause them. Each one depends on today's date, which is 2026-11-10 in this sandbox:

  • src/sample.test.ts: "no finished sample date reads late…". It finds the sample closing due 2025-11-14 marked done on 2025-11-15 after a refresh to today+6.
  • src/anniversary.test.ts: "a new database has one closed sample whose anniversary is today…". The anniversary draft comes back with on 2026-11-09 and due 2025-11-09, but the test expects it to be today's.
  • src/week.appointment.test.ts: "a day's timed dates come first…". The sample deal "1418 Alder Lane" has a walkthrough on today+2 and appears in the list the test expects to hold three deals.

My own tests pass: the new Review keys test in src/review.test.ts and the a11y, design and security suites.

I'd rather fix those three tests or the sample data on main than patch them on this branch. If the deploy ran on a day when these pass, a different test failed, so please send me the part of the log that has the (fail) line. I'll fix it as soon as I can see it.

commented

Review answers to S, D and T on the focused reminder card, and the full suite now passes (716 tests). The last push failed the preview only on three date-dependent tests. They also fail on a clean main, and I fixed them here.

The keys

  • static/review.js is 618 bytes and is served cached immutable through the usual /static/…?v=hash address.
  • The card takes focus on load, so the keys work without a click. Keys only act while focus is inside the card, never in an input, textarea, select or contenteditable. Ctrl, Meta and Alt combinations and held-down repeats are ignored.
  • S, D and T call .click() on the real Send, Don't send and Tomorrow buttons. The same server actions and same-origin check run as for a mouse click.
  • A visible hint line under the heading lists the keys. The card points to it with aria-describedby, and each button carries aria-keyshortcuts.
  • One test in src/review.test.ts checks the hint, the three data-key buttons, the immutable header, the 1 KB limit and the typing guard. It fails without the script or the hint.
  • D with an empty reason doesn't submit; the browser's required-field check focuses the reason box. If a reason is already typed, D submits.
  • T does nothing on a status reminder, which has no Tomorrow button.
  • I didn't run the script in a browser; the test checks the markup and the script's text.

The failing tests

  • Sample bug (two tests): the anniversary sample was marked done a day early whenever its due date rolled back to a business day. This year its due falls on Veterans Day, so the anniversary landed on 2026-11-09 instead of today and a refresh read it as late. In src/sample.ts, the anniversary sample's closing is now stamped on its anniversary day. Other samples are stamped as before.
  • Week test: the sample "1418 Alder Lane" also has a walkthrough two days from today, so it showed up in src/week.appointment.test.ts. The test now counts only its own three deals. The test was wrong, not the code.

I didn't run design-lint (it's scripts/lint-design.ts here) after the last commit, and bun x tsc --noEmit prints help text instead of checking because the clone has no tsconfig.json. No contract cell is loosened and there are no new dependencies.

To try it: open /reminders/today, press S, D or T, then click into the Message box and type those letters to see nothing fire.

🤖 Generated with Claude Code

commented

All three points are fixed and pushed. The full suite passes (716 tests).

The keys fix

  • static/review.js (667 bytes) no longer builds a selector from e.key. It lowercases the key and finds the button whose data-key matches. A double quote, backslash or bracket now does nothing instead of throwing.
  • The test in src/review.test.ts now asserts that Tomorrow carries data-key="t", alongside Send and Don't send. I dropped the substring checks on the script text.
  • Instead, the test runs review.js against a stand-in card, which checks that:
    • ", \, ] and Enter neither throw nor click.
    • S pressed inside a field does not click.
    • s, D and t press their buttons.

Scope (point 3)

  • I kept the src/sample.ts and src/week.appointment.test.ts changes in this pull and did not split them out. Three tests fail on a clean main today and fail the preview, so this pull can't land green without them. Both changes are minimal and unrelated to the keys.
  • The anniversary sample's closing is now stamped on its anniversary day, because its due date rolls back to a business day. The SQL is two plain statements in place of the conditional template.
  • The week test now counts only its own three deals; the sample deal "1418 Alder Lane" also has a walkthrough two days from today.
  • Please open a follow-up issue for the date-dependent sample tests if you want them tracked separately.

No contract cell is loosened and there are no new dependencies.

To try it: open /reminders/today and press S, D or T. Type those letters in the Message box to see nothing fire.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs