Step 17.7: plan amendments and regression
CI / check (push) Successful in 6m20s Details

CR-017 §6: plan 0.5.30, CR-001 (story, 0.5.22, Steps 10A.1, 10A.3,
10A.7, 10A.8) and CR-011 Step 10H.4 amended. Full suite and balance
targets pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
fireshaper 2026-10-10 16:25:00 -04:00
parent e6d273cfce
commit d57919b382
5 changed files with 16 additions and 5 deletions

View File

@ -1578,3 +1578,7 @@ Implementation decisions not spelled out in `memory-bank/implementation-plan.md`
- **Names**: the avatar is "You" (with "have"), others by first name ("Rosa has"); two pilots "both have", more "all have". - **Names**: the avatar is "You" (with "have"), others by first name ("Rosa has"); two pilots "both have", more "all have".
- **Go to Pilots also dismisses the tip**: the player has gone where it pointed. - **Go to Pilots also dismisses the tip**: the player has gone where it pointed.
- **The pop-up waits for delivery summaries**, like the deal sheet. - **The pop-up waits for delivery summaries**, like the deal sheet.
## Step 17.7
- **CR-001's own text is amended with notes, not rewritten**, as with earlier CRs: its 0.5.22 is marked as plan 0.5.30 and points at CR-017.

View File

@ -30,7 +30,7 @@ This change keeps the employee opening but cuts it to about four quick runs, giv
1. Player taps "Start your company" and lands straight on the tutorial contract board with a two-line intro. 1. Player taps "Start your company" and lands straight on the tutorial contract board with a two-line intro.
2. The board offers **three** contracts with different mass, pay, trip time, and XP. The loaner ship is a fast company Courier, so each run takes under a minute. 2. The board offers **three** contracts with different mass, pay, trip time, and XP. The loaner ship is a fast company Courier, so each run takes under a minute.
3. On the third run, the board includes one scripted special contract ("Unmarked crates — double pay, no questions asked"). 3. On the third run, the board includes one scripted special contract ("Unmarked crates — double pay, no questions asked").
4. After four runs (back at Earth), the company owner offers to sell the player his old Courier **and** his Earth bay lease **on credit**. 4. After four runs (back at Earth), the company owner offers *(amended by CR-017: after five runs)* to sell the player his old Courier **and** his Earth bay lease **on credit**.
5. The player accepts. They now own a ship and an Earth bay, owe a loan, and the tutorial is over. A cut of every payout goes to the lender until the loan is paid. 5. The player accepts. They now own a ship and an Earth bay, owe a loan, and the tutorial is over. A cut of every payout goes to the lender until the loan is paid.
6. HQ shows a short list of goals with credit rewards to guide the first session. 6. HQ shows a short list of goals with credit rewards to guide the first session.
7. From the first screen, the map shows every location; undiscovered ones are locked, and each one says which ship can reach it. 7. From the first screen, the map shows every location; undiscovered ones are locked, and each one says which ship can reach it.
@ -57,7 +57,7 @@ Record these in `DECISIONS.md` and in `implementation-plan.md` §0.5.
**New** **New**
- **0.5.21 Loaner ship.** The loaner is its own ship model, "Company Courier", marked not purchasable. It is faster and has lower overhead than the player's Courier so tutorial runs take under one real minute. - **0.5.21 Loaner ship.** The loaner is its own ship model, "Company Courier", marked not purchasable. It is faster and has lower overhead than the player's Courier so tutorial runs take under one real minute.
- **0.5.22 The deal.** Once the player has completed at least the configured number of tutorial runs and the loaner is at Earth with nothing in flight, a one-time deal becomes available. Accepting it removes the loaner, gives the player a Courier and an Earth bay, assigns the avatar to that Courier, sets the loan balance, and ends the tutorial. There is no decline option. - **0.5.22 The deal.** *(Plan 0.5.30; amended by CR-017: five runs, and the loaner may be anywhere.)* Once the player has completed at least the configured number of tutorial runs and the loaner is at Earth with nothing in flight, a one-time deal becomes available. Accepting it removes the loaner, gives the player a Courier and an Earth bay, assigns the avatar to that Courier, sets the loan balance, and ends the tutorial. There is no decline option.
- **0.5.23 Handling time.** Travel time gains a loading/unloading term: `travel time = distance ÷ cruise speed + overhead + cargo mass × handling time per tonne`. Repositions carry zero mass. Because XP is per delivery and pay is per tonne, light contracts earn more XP per minute and heavy contracts earn more credits per minute. That is the tradeoff on every board. - **0.5.23 Handling time.** Travel time gains a loading/unloading term: `travel time = distance ÷ cruise speed + overhead + cargo mass × handling time per tonne`. Repositions carry zero mass. Because XP is per delivery and pay is per tonne, light contracts earn more XP per minute and heavy contracts earn more credits per minute. That is the tradeoff on every board.
- **0.5.24 Loan.** The company has a loan balance. When a dispatch resolves with positive credits (after pilot pay), the lender takes `min(balance, credits × repayment share)`. The player can also pay down any amount up to the balance at any time. No interest, no missed payments, no fail state. - **0.5.24 Loan.** The company has a loan balance. When a dispatch resolves with positive credits (after pilot pay), the lender takes `min(balance, credits × repayment share)`. The player can also pay down any amount up to the balance at any time. No interest, no missed payments, no fail state.
- **0.5.25 Scripted tutorial contracts.** Content can define special tutorial contracts keyed to a tutorial run number. A scripted contract replaces one board slot on that run and can carry a custom name, pay multiplier, and a flavor message shown after delivery. - **0.5.25 Scripted tutorial contracts.** Content can define special tutorial contracts keyed to a tutorial run number. A scripted contract replaces one board slot on that run and can carry a custom name, pay multiplier, and a flavor message shown after delivery.
@ -70,6 +70,7 @@ Record these in `DECISIONS.md` and in `implementation-plan.md` §0.5.
- Add GameConfig fields: tutorial runs before the deal (default 4); tutorial board size (3); tutorial mass tiers (light, medium, full); handling time per tonne (game hours); loan repayment share (default 0.3); deal loan amount (default: Courier price + Earth bay lease). Lower starting credits to a small cushion (a few fuel loads). - Add GameConfig fields: tutorial runs before the deal (default 4); tutorial board size (3); tutorial mass tiers (light, medium, full); handling time per tonne (game hours); loan repayment share (default 0.3); deal loan amount (default: Courier price + Earth bay lease). Lower starting credits to a small cushion (a few fuel loads).
- Add a scripted tutorial contract entry: run 3, name "Unmarked crates", Standard cargo, pay multiplier 2, and a flavor message after delivery (for example: "Nobody asked what was inside. You got paid. Licensed hazardous-cargo pilots earn this kind of money every run."). - Add a scripted tutorial contract entry: run 3, name "Unmarked crates", Standard cargo, pay multiplier 2, and a flavor message after delivery (for example: "Nobody asked what was inside. You got paid. Licensed hazardous-cargo pilots earn this kind of money every run.").
- Add the onboarding goals list (see Step 10A.5 for conditions) with rewards. - Add the onboarding goals list (see Step 10A.5 for conditions) with rewards.
- **Amended by CR-017:** Tutorial runs before the deal default 5; a tutorial XP multiplier (default 2) joins GameConfig (Step 17.1).
- **Test:** All content still validates through its schemas. The Market's list of purchasable ships does not include Company Courier. Every scripted contract and goal references valid ids. Deal loan amount is greater than zero. - **Test:** All content still validates through its schemas. The Market's list of purchasable ships does not include Company Courier. Every scripted contract and goal references valid ids. Deal loan amount is greater than zero.
### Step 10A.2 — Sim: handling time ### Step 10A.2 — Sim: handling time
@ -84,6 +85,7 @@ Record these in `DECISIONS.md` and in `implementation-plan.md` §0.5.
- Update the Step 3.10 tests to match. - Update the Step 3.10 tests to match.
- **Test:** The board has exactly three contracts with three different masses, all within Company Courier capacity. Same inputs give an identical board. With two runs completed, the "Unmarked crates" contract appears at double pay; with any other count, it does not. The light contract gives more XP per real minute than the full one, and the full one gives more credits per real minute than the light one. The sum of the four slowest possible tutorial trip times is under 6 real minutes. - **Test:** The board has exactly three contracts with three different masses, all within Company Courier capacity. Same inputs give an identical board. With two runs completed, the "Unmarked crates" contract appears at double pay; with any other count, it does not. The light contract gives more XP per real minute than the full one, and the full one gives more credits per real minute than the light one. The sum of the four slowest possible tutorial trip times is under 6 real minutes.
- **Amended by CR-007:** Tutorial contracts carry named Standard goods made at the loaner's location and wanted at the other end (never Priority); masses stay at the three tiers (Step 10G.5). - **Amended by CR-007:** Tutorial contracts carry named Standard goods made at the loaner's location and wanted at the other end (never Priority); masses stay at the three tiers (Step 10G.5).
- **Amended by CR-017:** The timing test covers the five slowest runs, under 7 real minutes; tutorial runs earn double XP (Steps 17.2, 17.3).
### Step 10A.4 — Sim: loan repayment ### Step 10A.4 — Sim: loan repayment
- Add a pure function that splits a credit amount into repayment and net, given the loan balance and repayment share. - Add a pure function that splits a credit amount into repayment and net, given the loan balance and repayment share.
@ -119,6 +121,7 @@ Record these in `DECISIONS.md` and in `implementation-plan.md` §0.5.
- Buying ships, leasing bays, and hiring pilots return `tutorial_active` while the tutorial is on. - Buying ships, leasing bays, and hiring pilots return `tutorial_active` while the tutorial is on.
- Update the Step 6.3, 6.4, 6.5, 6.6, and 6.8 tests to match. - Update the Step 6.3, 6.4, 6.5, 6.6, and 6.8 tests to match.
- **Test:** After three runs, the deal is not available. After four runs ending at Earth, it is. With the configured count set to 3, the deal is not available until a fourth run returns the loaner to Earth. Buying a ship during the tutorial returns `tutorial_active` and changes nothing. - **Test:** After three runs, the deal is not available. After four runs ending at Earth, it is. With the configured count set to 3, the deal is not available until a fourth run returns the loaner to Earth. Buying a ship during the tutorial returns `tutorial_active` and changes nothing.
- **Amended by CR-017:** Deal available = tutorial on, runs completed ≥ the configured count (5), no tutorial run in flight; the loaner may be anywhere. After four runs it isn't; after the fifth, ending at the Moon, it is (Step 17.4).
### Step 10A.8 — Server: accept the deal ### Step 10A.8 — Server: accept the deal
- In one transaction: remove the loaner; create an owned Courier at Earth; create an Earth bay; assign the avatar to the Courier; set the loan balance to the deal loan amount; turn the tutorial off; set deal accepted. - In one transaction: remove the loaner; create an owned Courier at Earth; create an Earth bay; assign the avatar to the Courier; set the loan balance to the deal loan amount; turn the tutorial off; set deal accepted.
@ -126,6 +129,7 @@ Record these in `DECISIONS.md` and in `implementation-plan.md` §0.5.
- **Test:** Accepting when available produces exactly that state: one owned Courier at Earth crewed by the avatar, one Earth bay, the configured loan balance, tutorial off, no loaner. Accepting when not available fails with no changes. Accepting twice fails the second time. Two simultaneous accepts produce exactly one deal. - **Test:** Accepting when available produces exactly that state: one owned Courier at Earth crewed by the avatar, one Earth bay, the configured loan balance, tutorial off, no loaner. Accepting when not available fails with no changes. Accepting twice fails the second time. Two simultaneous accepts produce exactly one deal.
- **Amended by CR-010:** Accepting the deal also creates the veteran pilot at Earth, unassigned (decision 0.5.70, Step 10J.4). - **Amended by CR-010:** Accepting the deal also creates the veteran pilot at Earth, unassigned (decision 0.5.70, Step 10J.4).
- **Amended by CR-013:** The deal also creates the Clipper at Earth, crewed by the veteran; the loan is Courier + Clipper + Earth bay lease (Steps 10M.1, 10M.3). - **Amended by CR-013:** The deal also creates the Clipper at Earth, crewed by the veteran; the loan is Courier + Clipper + Earth bay lease (Steps 10M.1, 10M.3).
- **Amended by CR-017:** Accepting with the loaner at the Moon still puts the avatar and the Courier, and the veteran and the Clipper, at Earth (Step 17.4).
### Step 10A.9 — Server: loan repayment ### Step 10A.9 — Server: loan repayment
- Resolution applies the repayment from Step 10A.4: reduce the loan balance, add only the net to credits, and store the repayment on the dispatch. - Resolution applies the repayment from Step 10A.4: reduce the loan balance, add only the net to credits, and store the repayment on the dispatch.

View File

@ -69,6 +69,7 @@ Record these in `DECISIONS.md` and `implementation-plan.md` §0.5.
- "Reset map view" restores the default camera (centered, default zoom) and clears the saved camera. - "Reset map view" restores the default camera (centered, default zoom) and clears the saved camera.
- "Show tips again" clears the dismissed-tips list so one-time hints (for example the CR-001 intro card) can show again. - "Show tips again" clears the dismissed-tips list so one-time hints (for example the CR-001 intro card) can show again.
- **Test:** Component test: after panning and resetting, the camera matches the default. After clearing tips, a previously dismissed tip renders again. - **Test:** Component test: after panning and resetting, the camera matches the default. After clearing tips, a previously dismissed tip renders again.
- **Amended by CR-017:** A second one-time tip, the skill point pop-up (`skill-points`), which "Show tips again" also brings back (Step 17.6).
### Step 10H.5 — Server: rename company ### Step 10H.5 — Server: rename company
- Add a "rename company" endpoint per decision 0.5.57. Player state includes the company name. - Add a "rename company" endpoint per decision 0.5.57. Player state includes the company name.

View File

@ -85,7 +85,7 @@ These answer the pre-build review. Log each one in `DECISIONS.md` as it is imple
27. **Pilot location storage.** Only unassigned pilots store a location; an assigned pilot's location is derived from their ship. 27. **Pilot location storage.** Only unassigned pilots store a location; an assigned pilot's location is derived from their ship.
28. **Git hosting.** The repo is on a self-hosted Gitea instance: `http://192.168.1.107:3000/rory/deadhead-space-freight-tycoon`. CI uses Gitea Actions. 28. **Git hosting.** The repo is on a self-hosted Gitea instance: `http://192.168.1.107:3000/rory/deadhead-space-freight-tycoon`. CI uses Gitea Actions.
29. **Loaner ship** (CR-001). The loaner is its own ship model, "Company Courier", marked not purchasable. It is faster and has lower overhead than the player's Courier so tutorial runs take under one real minute. 29. **Loaner ship** (CR-001). The loaner is its own ship model, "Company Courier", marked not purchasable. It is faster and has lower overhead than the player's Courier so tutorial runs take under one real minute.
30. **The deal** (CR-001). Once the player has completed at least the configured number of tutorial runs and the loaner is at Earth with nothing in flight, a one-time deal becomes available. Accepting it removes the loaner, gives the player a Courier and an Earth bay, assigns the avatar to that Courier, sets the loan balance, and ends the tutorial. There is no decline option. 30. **The deal** (CR-001). Once the player has completed at least the configured number of tutorial runs and the loaner is at Earth with nothing in flight, a one-time deal becomes available. Accepting it removes the loaner, gives the player a Courier and an Earth bay, assigns the avatar to that Courier, sets the loan balance, and ends the tutorial. There is no decline option. *(Amended by CR-017, decisions 0.5.106 and 0.5.108:)* the configured count is 5, and the loaner may be anywhere: after five runs it is at the Moon, and accepting places the avatar at Earth.
31. **Handling time** (CR-001). Travel time = distance ÷ cruise speed + overhead + cargo mass × handling time per tonne. Repositions carry zero mass. Light contracts earn more XP per minute; heavy contracts earn more credits per minute. 31. **Handling time** (CR-001). Travel time = distance ÷ cruise speed + overhead + cargo mass × handling time per tonne. Repositions carry zero mass. Light contracts earn more XP per minute; heavy contracts earn more credits per minute.
32. **Loan** (CR-001). The company has a loan balance. When a dispatch resolves with positive credits (after pilot pay), the lender takes min(balance, credits × repayment share). The player can pay down any amount up to the balance at any time. No interest, no missed payments, no fail state. 32. **Loan** (CR-001). The company has a loan balance. When a dispatch resolves with positive credits (after pilot pay), the lender takes min(balance, credits × repayment share). The player can pay down any amount up to the balance at any time. No interest, no missed payments, no fail state.
33. **Scripted tutorial contracts** (CR-001). Content can define special tutorial contracts keyed to a tutorial run number. A scripted contract replaces one board slot on that run and can carry a custom name, pay multiplier, and a flavor message shown after delivery. 33. **Scripted tutorial contracts** (CR-001). Content can define special tutorial contracts keyed to a tutorial run number. A scripted contract replaces one board slot on that run and can carry a custom name, pay multiplier, and a flavor message shown after delivery.
@ -758,7 +758,7 @@ Steps 10M.1–10M.5 are specified in `memory-bank/change-requests/CR-013-veteran
### Step 12.3 — End-to-end: tutorial to first ship ### Step 12.3 — End-to-end: tutorial to first ship
- Playwright test against a real server and test database, with the server clock controllable via a test-only setting: start as guest → fly tutorial runs (advancing the clock) until affordable → buy a Courier → lease Earth bay → tutorial ends. - Playwright test against a real server and test database, with the server clock controllable via a test-only setting: start as guest → fly tutorial runs (advancing the clock) until affordable → buy a Courier → lease Earth bay → tutorial ends.
- **Test:** The E2E test passes and final state shows one owned ship, one Earth bay, and tutorial mode off. - **Test:** The E2E test passes and final state shows one owned ship, one Earth bay, and tutorial mode off.
- **Amended by CR-001:** Rewritten: guest → four tutorial runs → accept deal → state shows one owned Courier at Earth crewed by the avatar, one Earth bay, a loan balance, and tutorial off → one contract dispatched and resolved with a repayment applied. - **Amended by CR-001:** Rewritten: guest → four tutorial runs (five since CR-017) → accept deal → state shows one owned Courier at Earth crewed by the avatar, one Earth bay, a loan balance, and tutorial off → one contract dispatched and resolved with a repayment applied.
- **Amended by CR-011:** End-to-end tests (12.3–12.6) may use "Start a new company" and the developer tools (advance clock, add credits, finish flights) to reset and fast-forward. - **Amended by CR-011:** End-to-end tests (12.3–12.6) may use "Start a new company" and the developer tools (advance clock, add credits, finish flights) to reset and fast-forward.
- **Amended by CR-014:** End-to-end tests (12.3–12.6) run against the web build alone (a test build with developer tools), using the developer clock offset to fast-forward; "advance the server clock" means that offset, and "close the page" is reopening it with the offset already past the arrival (Step 14.7). - **Amended by CR-014:** End-to-end tests (12.3–12.6) run against the web build alone (a test build with developer tools), using the developer clock offset to fast-forward; "advance the server clock" means that offset, and "close the page" is reopening it with the offset already past the arrival (Step 14.7).

View File

@ -420,4 +420,6 @@ Spec: `memory-bank/change-requests/CR-017-tutorial-xp-skill-prompt.md` (received
- [x] **Step 17.4 — Engine: deal availability and placement.** (The rule itself changed in 17.1.) No save migration and no save-version change: the save keeps the completed-run count and the deal is computed from it, so a save with four runs done now simply needs a fifth. Tests (`packages/engine/test/deal-five-runs.test.ts`): after four runs the deal isn't on offer (and accepting is refused), after the fifth, ending at the Moon, it is; accepting puts the avatar on the Courier and Rosa on the Clipper, both at Earth, with no loaner left; a save from before CR-017 with four runs done, opened on this build, still has four runs and no deal until one more run. - [x] **Step 17.4 — Engine: deal availability and placement.** (The rule itself changed in 17.1.) No save migration and no save-version change: the save keeps the completed-run count and the deal is computed from it, so a save with four runs done now simply needs a fifth. Tests (`packages/engine/test/deal-five-runs.test.ts`): after four runs the deal isn't on offer (and accepting is refused), after the fifth, ending at the Moon, it is; accepting puts the avatar on the Courier and Rosa on the Clipper, both at Earth, with no loaner left; a save from before CR-017 with four runs done, opened on this build, still has four runs and no deal until one more run.
- [x] **Step 17.5 — Client: Pilots tab badge.** The Pilots tab badge now shows the total unspent skill points across all pilots (was the number of pilots with points), hidden at zero (`tabAttention` in `apps/web/src/layout/attention.ts`, decision 0.5.109). Tests (`apps/web/test/attention.test.tsx`): pilots with 2, 0 and 1 points count 3; on the Pilots screen, the badge reads 3 with You on 2 and Rosa on 1, drops to 2 after one raise, and disappears once all three are spent. - [x] **Step 17.5 — Client: Pilots tab badge.** The Pilots tab badge now shows the total unspent skill points across all pilots (was the number of pilots with points), hidden at zero (`tabAttention` in `apps/web/src/layout/attention.ts`, decision 0.5.109). Tests (`apps/web/test/attention.test.tsx`): pilots with 2, 0 and 1 points count 3; on the Pilots screen, the badge reads 3 with You on 2 and Rosa on 1, drops to 2 after one raise, and disappears once all three are spent.
- [x] **Step 17.6 — Client: skill point pop-up.** `SkillPointPrompt` (`apps/web/src/components/SkillPointPrompt.tsx`, decision 0.5.109): once the tutorial is over and the notification permission prompt is answered, a one-time tip (id `skill-points`) titled "Your pilots are ready to train" lists each pilot with unspent points ("**You:** 2 points · **Rosa:** 3 points"), with Go to Pilots (opens the Pilots tab) and Later; either dismisses it, and Show tips again brings it back. It waits for delivery summaries. The engine client keeps the permission request it makes after `acceptDeal` and exposes it as `ApiClient.notificationPrompt()` (settled at once on the web, where there is no prompt). The e2e `playToDeal` now expects the pop-up, with points for You and Rosa, and dismisses it. Screenshots: `docs/screenshots/17-6-skill-points-desktop.png`, `17-6-skill-points-phone.png`, `17-6-pilots-badge-phone.png` (badge 5). Tests: `apps/web/test/skill-point-prompt.test.tsx` (not during the tutorial; after the deal it waits for the permission answer, then lists You 1 and Rosa 2; Go to Pilots navigates and it stays gone; Later dismisses it until Show tips again, and only pilots with points are listed; no pop-up with no points); `apps/web/test/notifications.test.ts` (`notificationPrompt` settles only when the prompt after the deal is answered); e2e suite (9 pass). - [x] **Step 17.6 — Client: skill point pop-up.** `SkillPointPrompt` (`apps/web/src/components/SkillPointPrompt.tsx`, decision 0.5.109): once the tutorial is over and the notification permission prompt is answered, a one-time tip (id `skill-points`) titled "Your pilots are ready to train" lists each pilot with unspent points ("**You:** 2 points · **Rosa:** 3 points"), with Go to Pilots (opens the Pilots tab) and Later; either dismisses it, and Show tips again brings it back. It waits for delivery summaries. The engine client keeps the permission request it makes after `acceptDeal` and exposes it as `ApiClient.notificationPrompt()` (settled at once on the web, where there is no prompt). The e2e `playToDeal` now expects the pop-up, with points for You and Rosa, and dismisses it. Screenshots: `docs/screenshots/17-6-skill-points-desktop.png`, `17-6-skill-points-phone.png`, `17-6-pilots-badge-phone.png` (badge 5). Tests: `apps/web/test/skill-point-prompt.test.tsx` (not during the tutorial; after the deal it waits for the permission answer, then lists You 1 and Rosa 2; Go to Pilots navigates and it stays gone; Later dismisses it until Show tips again, and only pilots with points are listed; no pop-up with no points); `apps/web/test/notifications.test.ts` (`notificationPrompt` settles only when the prompt after the deal is answered); e2e suite (9 pass).
- [ ] Step 17.7 — Plan amendments and regression - [x] **Step 17.7 — Plan amendments and regression.** CR-017 §6 applied: plan 0.5.30 (five runs, loaner anywhere) and the 12.3 rewrite note; CR-001 §2's story, its 0.5.22, Steps 10A.1, 10A.3, 10A.7 and 10A.8; CR-011 Step 10H.4 (the second one-time tip). Full suite: typecheck, lint, 1291 unit tests and 9 e2e tests pass. Balance (both strategies, seed 12345): deal 3.7 min (target under 10), first Market purchase 92.9 (45–95), first discovery 49.5, loan paid off 136.1, no violations.
**Phase 17 is complete; stopped for review.** Manual check for the user: on a fresh company, fly five tutorial runs, accept the deal, check the pop-up shows points for both You and Rosa, then spend them from the Pilots tab and watch the tab's badge count down and disappear.