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

A signed-in Tour page walks the sample deals step by step, each step linking straight to the place it names #277

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Added a signed-in Tour page at /tour that walks the README's ten tour steps, each linking to the page it names. I ran the tour, speed, security, README, review and accessibility tests, scripts/lint-design.ts and the design test, and they pass.

Notes

shipped production is serving it deploy d2eada7

opened this

Added a signed-in Tour page at /tour that walks the README's ten tour steps, each linking to the page it names. I ran the tour, speed, security, README, review and accessibility tests, scripts/lint-design.ts and the design test, and they pass. I did not run the whole suite, tsc or the gate: the clone has no scripts/gate.ts, and bun x tsc gave no type check because the repo has no typescript dependency or tsconfig.

  • Page: GET /tour reads the deal list through permit (listDeals). A guest gets the sign-in answer. No role is added and no cell in contract.json is loosened.
  • Steps and links:

- The steps are the README's words verbatim, rendered as a numbered list, in src/tour.ts. Output is escaped, with only bold and ` code turned into markup, and src/pages/tour.ts` renders them. - Links go to Harbor View, Alder Lane (the deal page and its client timeline), Review, This week, People, Profile and the clock. Deals are found by address. - If a sample deal is gone, the step shows without a link and says "this sample deal was removed, so there is no page to open."

  • Header: the "Tour" link appears only while the viewer has at least one sample deal. layout takes a tour flag that each page passes through, and the clock's cache key now includes it. In src/routes.ts, headerFor replaces waitingFor and the 404 page's waitingIn.
  • README: one sentence under the tour heading points to Tour in the header. The steps themselves are unchanged.
  • Drift check: src/tour.page.test.ts fails if a README step differs from src/tour.ts. The existing src/tour.test.ts still passes untouched.
  • Docs and styles: GET /tour is in docs/TECHNICAL.md. The new classes are in docs/design/areas/tour.md and static/app.css.
  • Not done: I kept the full step wording instead of shortening it, because the README and the page must match exactly. Shortening both would be a separate change.

To try it, sign in, click Tour in the header, and follow any step's link.

🤖 Generated with Claude Code

Closes #275

6 earlier comments · 1 event
commented

Added a signed-in Tour page at /tour that walks the README's ten tour steps, each linking to the page it names. I ran the tour, speed, security, README, review and accessibility tests, scripts/lint-design.ts and the design test, and they pass. I did not run the whole suite, tsc or the gate: the clone has no scripts/gate.ts, and bun x tsc gave no type check because the repo has no typescript dependency or tsconfig.

  • Page: GET /tour reads the deal list through permit (listDeals). A guest gets the sign-in answer. No role is added and no cell in contract.json is loosened.
  • Steps and links:

- The steps are the README's words verbatim, rendered as a numbered list, in src/tour.ts. Output is escaped, with only bold and ` code turned into markup, and src/pages/tour.ts` renders them. - Links go to Harbor View, Alder Lane (the deal page and its client timeline), Review, This week, People, Profile and the clock. Deals are found by address. - If a sample deal is gone, the step shows without a link and says "this sample deal was removed, so there is no page to open."

  • Header: the "Tour" link appears only while the viewer has at least one sample deal. layout takes a tour flag that each page passes through, and the clock's cache key now includes it. In src/routes.ts, headerFor replaces waitingFor and the 404 page's waitingIn.
  • README: one sentence under the tour heading points to Tour in the header. The steps themselves are unchanged.
  • Drift check: src/tour.page.test.ts fails if a README step differs from src/tour.ts. The existing src/tour.test.ts still passes untouched.
  • Docs and styles: GET /tour is in docs/TECHNICAL.md. The new classes are in docs/design/areas/tour.md and static/app.css.
  • Not done: I kept the full step wording instead of shortening it, because the README and the page must match exactly. Shortening both would be a separate change.

To try it, sign in, click Tour in the header, and follow any step's link.

🤖 Generated with Claude Code

commented

I merged main into the branch and pushed the result. The branch merges cleanly again, and the tests I ran pass.

The only conflict was in src/routes.ts, in the /reminders/today handler. This pull had replaced waiting: waitingFor(c) with ...headerFor(c). main had added next: queue.value.length === 0 ? nextAfter(c) : undefined to the same call. The resolved line has both.

Another waitingFor(c) call that main brought in was a leftover caller of a helper I had removed. I switched it to ...headerFor(c), so no references to waitingFor remain.

I ran the Tour, README, review, coming-reminders, security, accessibility and speed tests (66 pass, 0 fail) and scripts/lint-design.ts (clean). I did not run the whole suite; the forge runs the full check on the push.

commented

The preview's one failing test, "the print rules hide navigation and stay scoped to the file page" in src/file.test.ts, passes again. I haven't seen the preview deploy re-run yet.

I had appended the Tour styles to the end of static/app.css, which put them inside the part of the file that test checks. That test requires every selector after the broker file's print block to start with .file-page, and .tour-list doesn't. I moved the Tour styles to just before that print block.

Locally, src/file.test.ts, src/design.test.ts and src/tour.page.test.ts pass (18 tests), and scripts/lint-design.ts is clean. I did not run the whole suite; the forge runs it on the push.

commented

The failing test, "the print rules are scoped to the timeline page" in src/timeline.test.ts, passes locally again. I haven't seen the preview deploy re-run.

My earlier fix was incomplete. It put the Tour styles before the broker file's print block but still after the first @media print. The timeline test requires every selector in that earlier print region to start with .timeline-page, and .tour-list doesn't.

I moved the Tour styles in static/app.css to before the first @media print. Locally src/timeline.test.ts, src/file.test.ts, src/design.test.ts and src/tour.page.test.ts pass (28 tests), and scripts/lint-design.ts is clean. I did not run the whole suite; the forge runs it on the push.

Changes requested — before the latest push

No high security finding: /tour reads through listDeals/permit, guests get the sign-in answer, output is escaped, no cell loosened. These need fixing in one round:

  1. Contract table: the new door /tour has no row in src/contract.test.ts (the diff does not touch it). Add the deal-list row for GET /tour (guest -> sign-in, user -> 200).
  2. Header Tour link is not consistent. Several pages now receive ...headerFor(c) but their page functions were not changed to accept or forward tour: timelinePage, missingPage (404) and welcomePage. The spread passes tour, but layout never gets it, so Tour is missing on the timeline and on 404 pages for a signed-in viewer (and weekPage passes neither waiting nor tour). Issue box 2 says the link shows whenever the viewer has the samples. Thread tour through every page that calls layout, and add a test that covers at least the timeline, week and a 404.
  3. Tests are weak in places. In src/tour.page.test.ts the last test asserts not.toContain('href="/deals/5"><') and then toContain('href="/deals/5"'), which proves nothing about a removed deal. Render with only the Alder deal and assert the Harbor step has no href="/deals/<id>" and shows the reason, while Alder's step keeps its link. without("") and as never are noise; use a real Who. Also assert the Tour link is absent when the viewer has no sample deal (hasTourDeals false), and that each of the ten steps carries a link or a reason.
  4. Clean: the one-line waiting?: number | undefined; tour?: boolean | undefined; pasted into activity, clock, deal, profile, refused, review pages is unformatted and breaks the repo's one-field-per-line style with its doc comments. Put tour on its own line with a comment. In src/tour.ts hasTourDeals uses a cast (s.go as { deal: string }); narrow with a type guard instead.
  5. /tour handler calls listDeals twice (once itself, once inside headerFor). Compute waiting/tour from the deals already read (waitingCount + hasTourDeals) to keep the common request fast.
  6. Both doors: the tour is a README feature, but nothing in src/tty.ts offers it. Either add a short tour view in the terminal reading the same STEPS through the same permit check, or state in the README/pull why the terminal has none.

Also, mason noted tsc was not run; run the type check path available and make sure items 2 and 4 type-check.

commented

I've addressed all six review items except one part of item 2, and pushed. The tests I ran pass (130 across 12 files), and scripts/lint-design.ts is clean. I did not run the whole suite; the forge runs it on the push.

  1. Contract row: src/contract.test.ts now has a "Tour, at GET /tour, answers as deal list says, as every identity" test. It follows the pattern of the existing People row. src/tour.page.test.ts still checks over HTTP that a guest gets 401 and a user gets 200.
  2. Header consistency: I disagree with part of this. timelinePage and weekPage are plain: true handouts, so the layout draws no navigation on them at all: no People, Review or Profile link either. Showing Tour there would be the one exception. I removed the useless ...headerFor(c) from the timeline and welcome calls instead. missingPage and refusedPage now forward tour, so a signed-in viewer sees Tour on a 404 and on a refused page. New tests cover the 404 and the absence of a header on timeline and week.
  3. Tests:

- The removed-deal test now renders with only Alder Lane. Both Harbor steps carry the reason and no /deals/<id> link, both Alder steps keep their links, and every step has either a link or a reason. It uses a real Who. - A new test checks that hasTourDeals is false when no sample deal is present, and that the header drops the Tour link then.

  1. Style:

- Each tour field is on its own line with a comment. - hasTourDeals narrows with "deal" in s.go instead of a cast.

  1. One read: the /tour handler now reads the deal list once and works out the Review count from it.
  2. Terminal: G lists the same ten steps from src/tour.ts. Each line says where to go (the path of the deal, timeline or page the step names), or that the sample deal was removed. It reads through listDeals, and a guest is refused. The README and docs/TECHNICAL.md say so, and a terminal test covers it.

Type check: I couldn't use the repo's tsc, because the repo has no typescript dependency. I installed TypeScript 5 in $TMPDIR with a strict config I wrote. It reports 78 errors both with and without my changes, and none are in the lines I touched. I cannot call items 2 and 4 type-checked by the repo's own settings.

commented

Nothing to push: the three failing tests fail identically on origin/main, so this branch did not cause them. I checked out a clean origin/main worktree and ran src/sample.test.ts, src/anniversary.test.ts and src/week.appointment.test.ts. The same three fail (the same three tests the deploy named), and my diff isn't in that tree.

Cause: the failures come from the sample deal 58 Larkspur Way, whose closing date is placed a year back. Today is 2026-11-10, so that date is 2025-11-11, Veterans Day. src/sample.ts (placed, with previousBusinessDay at src/sample.ts:422) rolls it back to Monday 2025-11-10. The "closed a year ago today" anniversary then lands a day early, and the tests expect today.

  • src/anniversary.test.ts gets a draft dated 2026-11-09 where it expects 2026-11-10.
  • src/sample.test.ts finds the closing "done" a day after it was due.
  • src/week.appointment.test.ts finds 1418 Alder Lane's closing in a row it expects to be empty.

What I left alone: I did not patch src/sample.ts or those tests on this pull. The fix changes how the sample's closing is placed, which belongs in its own change. It would also let a Tour-feature pull alter sample-deal behaviour. These tests should go green again once the date is no longer a day before a holiday, which is tomorrow, and the Tour pull changes nothing there. Someone should still fix the roll-back so the anniversary sample stays correct on days when a year back falls on a weekend or holiday.

Everything for the Tour feature, including the review fixes, is already on the branch at 4011ac7. The Tour tests, contract, terminal, accessibility and security tests pass locally.

commented

I merged main into this branch and pushed it. The only conflict was in src/pages/deal.ts, in the final layout(...) call of the deal page.

  • Resolution: I kept both sides. The call now has sheets: false from main and tour: input.tour from this pull.
  • Checks: bun x tsc --noEmit printed no errors, and the test run was 730 pass, 0 fail. The test run was a bare bun test over everything, because scripts/fast.ts doesn't exist in this clone. It was meant to be a targeted run.
  • Not run: scripts/gate.ts and scripts/design-lint.ts don't exist in this clone either, so I skipped both.
  • Untracked files: .bash_profile, .bashrc and .claude/ are in the clone's working tree but untracked. I left them out of the commit.

Nothing else changed beyond the merge. To try it, open /tour on the preview at https://deal-clock--277--forge-trevato-apps.open-platform.sh.

🤖 Generated with Claude Code

Approved

Approved. I could not fetch the previous head into my clone, so I read the diff as given. I could not check the preview as a signed-in user either, because it answers 401 to the bearer token alone. Earlier asks are met: the contract row for the Tour (it follows deal list, no cell loosened), the header Tour link passed through the pages, the removed-deal test, the single deal read in the /tour handler, and the terminal G view that reads through listDeals and refuses guests. The drift test holds the README to src/tour.ts. Output is escaped, with only bold and code marked up afterwards. Non-blocking: the terminal test title ends with a stray ", ".

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs