Repository navigation
Page "Your signups" so every signup in a workspace can be reached - #871
Conversation
The dashboard stopped at the newest 200 signups and counted only the rows it showed. It now pages 200 at a time by (created_at, id), with "Show older signups" and "Back to newest signups" links, and shows the workspace's real total. The cursor is the last row's id, looked up in Postgres, because created_at keeps microseconds a JavaScript Date drops. Fixes #848. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SSFBkFcnugautFNVZD
Tophat: passedI ran 25dcf8b locally with
For the owner (UX): "Your signups" now gives the workspace's real total (it used to stop at "200 total"). A workspace with more than 200 signups gets a Show older signups link under the list, and on older pages a Back to newest signups link. A workspace with 200 or fewer looks the same as before. Screenshots are in https://claude.ai/code/session_016YZ9SSCjB2K7182f3MEd1C. (Link corrected: the first version of this comment pointed at a session that doesn't exist.) Generated by Claude Code |
richshaw
left a comment
There was a problem hiding this comment.
Review: passed (round 1)
This PR pages "Your signups" with a keyset cursor and shows the workspace's real total, as #848 asks. The new service function runs requireWorkspaceAccess first and builds its filter from workspaceSignupsWhere, so workspace_id scoping and the deleted/archived rules match the old list. The cursor subquery is limited to the same workspace, so another workspace's id gives an empty page, and the dashboard then falls back to page 1. Postgres compares created_at against itself, so microseconds are kept and nothing passes through a JavaScript Date. The (created_at, id) order gives ties a fixed order. Each item in "Done when" is covered: the db tests for 201 rows with one archived and one deleted, a tie group across the page boundary (rows 0–9 share a time and the break falls at row 5), the label and link unit tests, and CI.
Blocking (0)
Optional (2):
src/app/app/(chrome)/page.tsx:29: the dashboard calls the services directly, not throughsignups.cached.ts. It did that before this PR, and nothing else on the page reads the same data, so per-request dedupe would change nothing.src/services/signups.ts:647:listSignupSummariesForWorkspace, which MCPlist_signupsstill uses, orders bycreated_atalone with noidtie-break. That's harmless while it returns a single capped page, but whoever pages that tool later should reuse the new function.
Earlier threads: none. Copilot couldn't review (quota).
Checks: CI is green on 25dcf8b (lint-type-test, e2e, CodeQL). The branch merges cleanly into current main (6629400). The tophat on 25dcf8b passed, and nothing has changed since.
Why the owner: this is UX. The dashboard heading now shows the real count, and workspaces with more than 200 signups get Show older signups / Back to newest signups links. Screenshots 871-before-dashboard, 871-after-dashboard-page1 and -page2 are in the tophat comment's session. Workspaces with 200 or fewer signups look the same as before.
https://claude.ai/code/session_016YZ9SV6EaeCHhqr4zfs7qK
Generated by Claude Code
The empty state below the heading already invites a first signup, so the line under "Your signups" repeated it. signupCountLabel now returns null for an empty workspace and the page renders no line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SMvnCH9GDDXmwQWcQh
Tophat: passed (after the owner's change)The owner asked to drop the "No signups yet. Start one below." line under the title of an empty dashboard, because the empty state below it already invites a first signup.
I ran 6c1cbf3 locally with
The paging code didn't change, so the paging checks in the tophat above still hold. Screenshots are in https://claude.ai/code/session_016YZ9SMvnCH9GDDXmwQWcQh. Generated by Claude Code |
The two text links under a 200-row list gave no sense of position and sat
where only someone who scrolled to the end would find them. Past one page
the list card now has a bar above and below it, in the table-header style
the organizer pages already use: the range showing ("201-400 of 420") and
Newer / Older buttons, the dead end dimmed. It is still plain links, so
/app adds no client JavaScript.
Newer is a real previous page: listSignupSummaryPageForWorkspace takes an
`after` cursor beside `before`, and a page reached by a cursor counts the
signups either side of it for its offset and both links. The first page
still runs one query. The count line under the heading only shows when
everything fits on one page, since the bar says it otherwise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SMvnCH9GDDXmwQWcQh
Tophat: passed (new pager, at the owner's request)The owner asked for a better paging experience than two text links. I ran b96f3d7 locally with
For the owner (UX): a workspace with 200 or fewer signups looks as before ("N total", and no line when it's empty). Past 200, the line under the heading goes, and the list card gets the bar at its top and bottom. You can see where you are and step either way from both ends of the list. Screenshots are in https://claude.ai/code/session_016YZ9SMvnCH9GDDXmwQWcQh. Generated by Claude Code |
The owner preferred the pager as a footer rather than a bar at both ends. With nothing at the top, the "N total" line under the heading shows on every page again, as it did before the pager. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SMvnCH9GDDXmwQWcQh
Tophat: passed (pager as a footer only)The owner asked for the pager as a footer rather than a bar at both ends. I ran a7c5dec locally with
Note for the review stage: the review marker above passed 25dcf8b, the original two-link version. Since then the PR has a new Screenshots are in https://claude.ai/code/session_016YZ9SMvnCH9GDDXmwQWcQh. Generated by Claude Code |
…total The owner's call: the total isn't something an organizer needs at the top. A list longer than one page still says "201-400 of 420" in its footer, and the count query now runs only for such a list, so a dashboard that fits on one page (most of them) makes one query instead of two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SMvnCH9GDDXmwQWcQh
Tophat: passed (count line removed)The owner asked to drop the count under the heading: the total only needs to be in the pager's footer. I ran ebce062 locally with
This still needs a fresh review: the last review marker is for 25dcf8b. Screenshots are in https://claude.ai/code/session_016YZ9SMvnCH9GDDXmwQWcQh. Generated by Claude Code |
richshaw
left a comment
There was a problem hiding this comment.
Review: passed (round 2)
Since round 1 (25dcf8b), the PR has gained an after cursor, a position count, and a footer pager, and it no longer shows the count line. listSignupSummaryPageForWorkspace still calls requireWorkspaceAccess first and still filters with workspaceSignupsWhere. Both cursor subqueries (placeOf) are limited to workspace_id, so another workspace's id compares against NULL and matches nothing, and the page then falls back to page 1. The newer/older counts use the same strict (created_at, id) comparison as the page query, so the offset and both links stay right when signups share a created_at. The after page reads ascending and then reverses, so it comes back in the same order as the before page. newerSignupsHref sends any page whose offset is ≤ 200 to plain /app, so deletions can't leave a short first page. The count runs only when there is more than one page. Each claim in the description has a test: 201 rows with one archived and one deleted, ties across the boundary, a run within one millisecond, three pages walked older and back newer, an unknown cursor in both directions, and a non-member being refused. The unit tests cover parsing, the label and the links. No help article mentions the old "N total" or "No signups yet" lines, and neither does any e2e spec. The CHANGELOG entry describes the final state.
Blocking (0)
Optional (2):
src/app/app/(chrome)/page.tsx:44: an Older link whose remaining rows were all deleted before the click lands on page 1, not on an empty last page. That's reasonable, just worth knowing.src/services/signups.ts:listSignupSummariesForWorkspace(the API and MCPlist_signups) still orders bycreated_atalone. This carries over from round 1 and is harmless while it returns a single capped page.
Earlier threads: none. Copilot couldn't review (quota).
Checks: CI is green on ebce062 (lint-type-test, e2e, CodeQL). The branch is behind main but merges cleanly. The tophat passed on ebce062, the head, so runtime code hasn't changed since. Locally I read the diff, the tests and the help and e2e references; I didn't need to run anything to prove a finding.
Why the owner: this is UX. The count line under "Your signups" is gone on every dashboard. Past 200 signups, the list card gets a footer with the range ("201–400 of 420") and Newer / Older buttons. Workspaces with 200 or fewer signups look the same as before, minus the count line. Screenshots: 871-final-phone-page2-top and the 871-footer-* / 871-pager-* shots in the tophat sessions linked above.
https://claude.ai/code/session_016YZ9STxu21edYpyA6cQQPd
Generated by Claude Code
…board-paging # Conflicts: # src/app/(organizer)/app/(chrome)/page.tsx
Conflict with #1057 resolved in
|
Tophat: passed (after the merge of #1057 and #1058)I ran 49e609e locally with
Since the last tophat (8b74d03), the only runtime change is the row link, which now comes from
For the owner (UX): nothing changed from what you approved at Screenshots are in https://claude.ai/code/session_016YZ9SU1jgBBDg5dRsLFudD. Generated by Claude Code |
richshaw
left a comment
There was a problem hiding this comment.
Review: passed (round 4)
Round 3 passed this PR at 8b74d03, and the owner approved that head. Since then the only change is 49e609e, which merges main in and resolves a conflict with #1057. I compared the PR's own diff against main at 8b74d03 with its diff now. The only differences are on the dashboard row link: it now uses signupTabPath(r.id, 'build') and imports it from src/lib/organizer-paths.ts, and main's copy of const locale = … in generateMetadata is no longer a hunk in this PR. signupTabPath returns /app/signups/${signupId}/${tab}, so the URL is the same as before. The paging service, cursor handling, pager, catalogs and tests are byte-for-byte what round 3 reviewed. listSignupSummaryPageForWorkspace and countSignupsForWorkspace still call requireWorkspaceAccess first and filter with workspaceSignupsWhere.
Blocking (0)
Optional (0): round 3's note on a soft-deleted id as a cursor still applies. No link the app makes produces one.
Earlier threads: none. Copilot couldn't review (quota).
Checks: CI is green on 49e609e (lint-type-test, e2e, CodeQL), and mergeable_state is clean against main (03a1190). The tophat passed on 49e609e, the head, so no runtime code has changed since. Locally I diffed the PR's own changes at 8b74d03 against the head. Nothing needed running to prove a finding.
Why the owner: this is UX. The approval at 8b74d03 doesn't carry over, because the merge after it resolved a conflict in runtime code (the address stage said the same). What you'd see is what you approved: no count line under "Your signups", and past 200 signups a footer on the list card with the range and Newer / Older ("Nyare" / "Äldre" in Swedish). The latest tophat's screenshots are 871-phone-page2-footer and 871-sv-phone-page1-footer.
https://claude.ai/code/session_016YZ9SUr6GgW5w1PihuqFi5
Generated by Claude Code
|
Approved by the owner at The owner approved this head in a live session and asked for it to be brought up to date and merged. The branch is only behind https://claude.ai/code/session_016YZ9SUTbBzWCJ45BqmkVnV Generated by Claude Code |
Fixes #848.
The problem
The organizer dashboard listed only the newest 200 signups (
WORKSPACE_LIST_LIMIT), so a workspace with more had no way to reach its oldest ones. Its heading counted the rows that came back, so it said "200 total" no matter how many signups there really were.The fix
listSignupSummaryPageForWorkspace(src/services/signups.ts) returns one page of up to 200 live signups, itsoffsetin the list,nextBefore(the id to page older from) andprevAfter(the id to page newer from). It uses keyset paging ordered by(created_at, id)descending, so signups with the samecreated_atkeep a single order. Same guard and scoping as before:requireWorkspaceAccess,workspace_id, deleted signups left out, archived ones kept.beforefor older,afterfor newer) runs one more query. It counts the live signups on either side of the page, which gives its offset and both links exactly.(created_at, id)in a row-value subquery. The issue suggested putting(created_at, id)in the URL, butcreated_atkeeps microseconds and a JavaScriptDatekeeps only milliseconds. A timestamp sent through the URL would be rounded, and signups made within the same millisecond would be skipped. The subquery is also limited to the workspace, so another workspace's id matches nothing.countSignupsForWorkspace: onecount(*)over the sameworkspaceSignupsWhere. This is Count every signup on the dashboard, not just the 200 listed #851's version.src/app/app/(chrome)/page.tsx): reads?before=or?after=. A missing or garbled cursor, or one that matches nothing here, shows the first page and never an error.dashboard-pager.tsx). It shows the range out of the real total ("201–400 of 420") and Newer / Older buttons; the one with nowhere to go is dimmed and inert. The count query runs only then, so a dashboard that fits on one page makes a single query.bg-surface-raisedbar, a hairline divider, and secondary buttons with Lucide chevrons, 44 px tall on phones and 36 px frommd./app.<Link>s, so the page adds no client JavaScript.dashboard-paging.ts, with unit tests.GET /api/signups, the MCPlist_signupstool and the existing list functions are unchanged, as the issue scoped.affected-articles.mjsfinds no help article affected: the articles name only the "Your signups" heading.Tests
signups.db.test.ts, with plain inserted rows:nextBefore. The next page is just the archived oldest one, at offset 200. Newer from there gives back the first page exactly.created_atacross a page edge. The offsets are 0, 200 and 400, every signup appears exactly once, and Newer from page 3 gives back page 2 row for row.created_atacross the page boundary: each signup appears exactly once.beforeorafterthat names no signup in the workspace returns an empty page.dashboard-paging.test.ts: cursor parsing (both params, precedence, missing, empty, repeated, wrong prefix, garbled, too long), the range label, and the Newer / Older links.pnpm lint,pnpm format:check,pnpm typecheck,pnpm knip,pnpm test(2204).pnpm test:db(682) andpnpm build && pnpm budgetspassed at b96f3d7; the later commits only change the page and its helpers. axe (WCAG A/AA and best practice) finds nothing on the first, middle and last pages.🤖 Generated with Claude Code
https://claude.ai/code/session_016YZ9SMvnCH9GDDXmwQWcQh