paseo-follow-up 2.4.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,39 @@
2
2
 
3
3
  What changed in each version of Follow-up, newest first. Follow-up shows "What's new" after an update that brings new release notes: the curated part of each stable release since you last looked (betas install quietly; Settings → General can turn it off), and every version's notes from Home's version line.
4
4
 
5
+ ## 2.5.0 (2026-11-26)
6
+
7
+ Send a task at the time you pick, and read every release in one scroll.
8
+
9
+ - **Tasks can go out at a set time.** Pick At a time in Send on a schedule, or let an agent set its own check-back. The task reaches the agent once at that time, even with Auto-send off.
10
+ - **What's new is one scroll, like Paseo's.** Every version newest first, with its date and an Installed tag on yours. Nothing to open, and each version's full changelog is one click away on GitHub.
11
+
12
+ <details><summary>Full changelog since 2.4.2</summary>
13
+
14
+ ### Repairs and PRs
15
+
16
+ - A task can be sent to its agent at a time: pick At a time in Send on a schedule, or let an agent set its own check-back. It arrives once at that time, even with Auto-send off.
17
+
18
+ ### Setup, Settings and updates
19
+
20
+ - What's new is one scroll: every version's changes, newest first, with its date and an Installed tag on yours. Nothing to open, and each version's full changelog is one click away on GitHub.
21
+
22
+ </details>
23
+
24
+ ## 2.4.2 (2026-11-26)
25
+
26
+ A shorter, current plugin page.
27
+
28
+ - **The plugin page says what Follow-up is today:** one inbox for every agent, what it does, how to install it, and a link to what it reads and writes.
29
+
30
+ <details><summary>Full changelog since 2.4.1</summary>
31
+
32
+ ### More
33
+
34
+ - The plugin page is short and current: what Follow-up does today, how to install it, and a link to what it reads and writes.
35
+
36
+ </details>
37
+
5
38
  ## 2.4.1 (2026-11-26)
6
39
 
7
40
  Two fixes for 2.4.0.
package/OVERVIEW.md CHANGED
@@ -1,58 +1,39 @@
1
1
  # Follow-up
2
2
 
3
- Follow-up watches every pull request a Paseo workspace opens until the work is actually done. It shows each PR stack at a glance, gathers conflicts, failing required checks and review threads into one repair batch for the workspace's main agent, and tells you when something needs you, such as an approved PR to merge, a question the agent asked or a batch to send. Answer a question in Follow-up and the answer goes straight to the agent's chat.
4
-
5
- ## What you see
6
-
7
- - Home: every workspace grouped by what it needs from you (Needs you, Sending, Running, Waiting on others, Quiet), with the selected one beside the list so you can allow a permission, answer, merge, reply or sign off in place, and a brief with what Follow-up did while you were away. Above the list: the status counts, provider limits from Smart Session when it's installed, a search over names, branches, PRs, agents and asks, and a sort menu (Priority, Recent, Oldest waiting, Name, By project).
8
- - The Overseer (1.4 beta), pinned on Home: one agent you talk to about all your workspaces. It forwards your asks to the agent that owns them, asks you when it isn't sure, and starts a new workspace only when you say so. You can ask it from Home's search box (the last row, "Ask the Overseer: …") or with ⌘K → Follow-up: Ask the Overseer.
9
- - AI priority (1.4 beta): Home's Priority sort ranked from your Linear issues, Slack DMs and mentions, GitHub review requests and the weekly plan, each row with a one-line reason that names its source. It runs hourly on workdays, only when something changed, and Re-rank now is in the sort menu.
10
- - Summary, a collapsible section at the top of Home's detail pane and the workspace panel: a one-line gist, a short AI overview of what the workspace is for and where it stands, and its linked Linear issues, PRs, Slack threads and docs.
11
- - A workspace panel for the open workspace only, with a Home button: PRs merged, what needs you, what needs fixing, a bar with one segment per PR, and what the agent is doing now. "Open full" on Home docks it beside the agent's chat.
12
- - A Needs you card with one button per decision: Send repairs, Merge, Resume, Retry, or Answer.
13
- - Questions from the main agent, each with a permanent ref (Q1, Q2…), lettered options, the agent's recommendation and what it does while it waits. Pick an option, add a note and Send it to the agent, or Copy it instead. Answered questions stay listed under their ref, and the question mode setting (Stop, Work around, Keep building) tells agents what to do until you answer.
14
- - A Spec link in the header to the page that sums up the workspace, usually the Claude artifact the main agent keeps up to date.
15
- - An Activity card: repairs sent and finished with how long they took, merges, PR actions and questions.
16
- - Each stack drawn top to base, merged PRs folded away, and a sheet per PR with checks, reviewers and Merge.
17
- - Tasks for work that outlives a merge. Each comes due by fact: its PRs merged or deployed, or a re-check date. A task can also be sent to the agent as a message after a merge or deploy, with an optional delay.
18
- - A composer pill and a sidebar count that appear only when something needs you; the pill steps through open questions so you can answer without leaving the chat. Home lists every workspace by who is up next, and a larger view opens a workspace in two columns.
19
- - Compact rows for Follow-up's own tool calls in agent chats, a card for each repair batch, and a card when the agent declares Done.
20
-
21
- ## Setup
22
-
23
- Requires Paseo 0.15+ and Node 22+. GitHub is optional: with an authenticated `gh` on the daemon host (or `GH_TOKEN`), Follow-up reads PRs, checks and reviews and can merge and request reviewers; without it, workspaces, Needs you, questions, briefs, Catch up, the Overseer, tasks and Compass work as before, Follow-up makes no GitHub request and runs no `gh`, and each GitHub surface says in one line how to turn it on (installing and signing in is picked up without a restart). Works with plain GitHub; Graphite is optional and picked per repository (Auto chooses Graphite only where the `gt` CLI is installed, signed in and the repository was set up with `gt init`). In Graphite repositories Merge uses saved Graphite CLI authentication; elsewhere it runs `gh pr merge`, and When ready is GitHub auto-merge. Follow-up follows every workspace that has an agent; Settings has per-project and per-workspace exceptions. The optional Send to Paseo browser companion adds Graphite's Merge when ready switch through its existing pairing; it is not needed for anything else.
24
-
25
- ## What it does on its own, and what it never does
26
-
27
- Auto-send ("Send repairs automatically") is on by default for every followed workspace; 1.3.0-beta.2 turned it on once for existing ones after backing up the state file. With it off, each repair batch waits for your click; with it on, Follow-up sends batches once the main agent is idle, after fresh permission and Session Guard checks. Follow-up never merges, turns on merge when ready, requests reviewers or archives on its own, and Merge always re-checks the stack and asks again. Done needs the main agent's declaration, settled PRs and tasks, and no open questions. Answers are sent only when you click Send; an answer the agent can't take yet waits and goes out on the next check, and one Paseo didn't confirm waits for you to Resend. An optional recovery agent can rebuild missed PRs and tasks from a workspace's history; it runs only when you start it and never edits code. Deployment checks and reviewer shortcuts exist only for specifically configured repositories; elsewhere deployment stays unknown.
28
-
29
- ### What agents can do for you
30
-
31
- Every root agent Paseo launches (tracked or not) gets Follow-up's action tools: `list_prs`, `add_reviewers`, `merge`, `enable_merge_when_ready`, `disable_merge_when_ready`, `send_repairs`, `set_auto_send`, `clear_hold`, `retry_batch`, `track`, `inbox_list`, `sign_off`, `snooze`, `set_finish_flags`, `set_priorities`, `set_wait_for_jobs` and the read-only `workspace_about` (a workspace's overview and linked items) and `release_notes` (the installed version and its notes), `updates_status` and `check_updates` (Settings → General, Check now), with `set_updates` and `install_update` as confirmed plans (external priorities for Home's Priority sort, kept in `plugin-data/follow-up/priorities.json`). Each runs the server path its button runs, with the same guards (tracked workspace, hold, PR eligibility, merge blockers), across every tracked workspace, so an orchestrating agent can act "on all" when you ask it to. Tools that act on a list, and merge, return a dry run and run only with `confirm: true` and that plan's id; merge is marked destructive and the list tools read-only. Inbox tools act on other agents only: an agent can't sign itself off. Recovery agents, contributors and subagents never get them, and the daemon re-checks the caller on each call. Each agent action is kept in the inbox's delivery ledger as `by: "agent:<id>"`; it never counts as you writing to an agent. A sign-off is still a sign-off made on your behalf, so it clears the flag. There is no tool to untrack or archive a workspace, or to put one on hold, because Follow-up has no button for those either.
32
-
33
- ## Data and access
34
-
35
- This is a trusted, unsandboxed plugin. It reads workspace metadata, saved agent history and configuration, GitHub status and existing CLI authentication, and keeps its state in `plugin-data/follow-up` on the daemon host. It attaches scoped agent tools per session (served by Paseo's own MCP as `follow_*` on Paseo 0.15+, a per-launch stdio bridge otherwise; never a global MCP registration, and it removes the user-scope `follow-up` entry older versions wrote, keeping a `.follow-up-unregister.bak` of each file) and reversible provider hooks for tracked sessions and, while the Needs-you inbox is on, the `needs_you` tool and its Stop-hook nudge for root agents (see below). To find the spec link it reads completed Claude Artifact publish results in the workspace's root sessions, never page content, chat links or the repository; a link you set wins over the agent's, which wins over detection. Repair prompts go to your configured agent and provider. For the provider meters it calls the Smart Session plugin's `smart-session.subscriptions` and `smart-session.budget` RPCs at most once a minute, or reads the newest rows of its `plugin-data/smart-session/accounts-YYYY-MM.jsonl`; it never asks ZeroSub to refresh or switch. It has no Slack identity and no background channel scanning; replies to stakeholders need your authorization and a sent-message receipt from the agent.
36
-
37
- Follow-up reads Paseo's agent, workspace and project lists into one in-memory directory shared by discovery, runtime checks, the Needs-you inbox, the Overseer and every client RPC. It reads the lists once at start, then patches the directory from lifecycle events: turn started or ended, permission requested or resolved, agent created, closed or archived, workspace created or archived. A change marks it dirty, and a dirty directory re-reads at most once a minute; a clean one re-reads every ten minutes. Before anything that would load an agent (a timeline or provider-subagent read), Follow-up re-reads that one agent, because the cached copy may predate Paseo unloading it. Provider subagents are asked about only when a send is due or waiting for acknowledgment, or completion is being checked. The Done label is sent only when it changes. In the app, the panel, the larger view and the pill draw from the client's shared workspace poll, which runs every 15 s plus a refresh shortly after Paseo reports an agent change. The inbox runs the same way and passes the tag of the list it holds, so an unchanged list comes back empty. Display preferences re-read once a minute. None of these poll while the app is hidden.
38
-
39
- The PR workflow setting lives in `plugin-data/follow-up/pr-workflow.json` (owner-only): the default, per-repository overrides, merge methods and the review-fix instruction. Auto-detection reads only files: PATH for a `gt` executable, `<config>/graphite/user_config`, `<config>/graphite/auth`, then `~/.graphite_user_config` for a sign-in token's presence (`<config>` is `$XDG_CONFIG_HOME` or `~/.config`) (never sent anywhere by detection), and `<git dir>/.graphite_repo_config` in the checkout of the repository's Paseo project, then in the working directories of tracked workspaces with PRs in that repository (from the agent list Follow-up already has). It never runs `gt` and caches for ten minutes. Repositories that resolve to GitHub get no Graphite API calls; their readiness, merge method and auto-merge come from the same `gh api graphql` query that already reads each PR, so there is no extra polling. The first start with this setting seeds the review-fix instruction to `/fix-pr` when `~/.claude/commands/fix-pr.md` or `~/.claude/skills/fix-pr/SKILL.md` exists, once.
40
-
41
- Reviewer lists live in `plugin-data/follow-up/reviewers.json` (owner-only), apart from `state.json`. Each list is per repository, plus a default for repositories without one, and each user keeps their own. Collaborator and team suggestions are read with `gh api` only when you open Add reviewer. They are cached for ten minutes, and never polled.
42
-
43
- The Needs-you inbox (beta) keeps one flag per root agent in `plugin-data/follow-up/inbox.json`. When a turn starts it reads the newest user message from the agent's recent timeline to tell your messages from automation, and it reads, never writes, Defer's `plugin-data/defer/queue.json`, Smart Session's `plugin-data/smart-session/compactions.json`, Session Guard's `plugin-data/session-guard/state.json` and Paseo's schedule records. An unknown or unreadable format counts as your message, which clears a flag rather than adding one. Signing off also clears Paseo's own unread dot for that agent. The first-run import and the restart check read only Paseo's agent list: an agent's last activity is its unread time or your last message to it, never Paseo's `updatedAt` (which the daemon rewrites in bulk), and they don't fetch timelines, which would load every agent. Closed and archived agents are never imported. Turning the inbox off stops all of this.
44
-
45
- The brief (beta) is stored on the agent's inbox entry and appended to its timeline as a Follow-up row; re-appending replaces that row, and the restart check ignores the `updatedAt` change the append causes because it never reads `updatedAt`. To build a brief Follow-up reads only what it already has: the agent's `needs_you` call, the permission request's title, the failed turn's error message, Session Guard's note and reset time for a paused agent, and its own PR state. It does not read or quote the agent's reply. While the inbox is on, every root Paseo agent on Claude Code or Codex gets Follow-up's MCP bridge with the `needs_you` tool only (tracked main agents keep their full set), and `plugin-data/follow-up/brief.json` records whether the inbox and the nudge are on and which agents have a permission prompt showing. Clicking an option or Retry sends one message as you; it is logged in the delivery ledger as yours, so it clears the flag. The Stop hook, part of the same reversible provider hooks Follow-up already installs, now also runs for those root Claude Code sessions: if the turn ended without `needs_you`, it blocks the stop once with a one-line request to call it, records that it did in `hook-state`, and never blocks the same turn again. It reads `brief.json`, its own per-turn marker and the time of the agent's last `needs_you` call, and nothing else. Turn it off with *Ask agents to state what they need*; turning the inbox off stops it too.
46
-
47
- The Overseer (beta) is one Claude agent in a Follow-up workspace under `plugin-data/follow-up/overseer-home`, labelled `follow-up.overseer=1` and created only when you click Start. Its id is kept in `plugin-data/follow-up/overseer.json`. Discovery, tracking, auto-send and Needs you skip its workspace. At the start of each of its turns, the provider hook adds a digest from `plugin-data/follow-up/overseer-digest.json` and records what it showed in `hook-state/overseer-seen-<agent>.json`. The worker builds that file when the Overseer's turn starts (and every 10 minutes as a backstop), from Paseo's workspace list (metadata only, at most once a minute) and Follow-up's own state; the hook waits up to 1.5 s for that turn's build. It skips the build while the resource governor pauses background work. Its tools are `workstreams`, `agent_digest`, `route_candidates`, `send_to_agent` and `start_workspace`. For an agent that isn't loaded, `agent_digest` reads the provider's transcript on disk, read-only (Claude Code's `projects/<cwd>/<session>.jsonl`, Codex's `sessions/**/rollout-*-<thread>.jsonl`; only the last 512 KB, and never the credentials in Paseo's agent record). Without a transcript it uses Follow-up's goal and PR titles. It never reads that agent's timeline. `send_to_agent` writes your words to the delivery ledger first: as yours only when they answer that agent's open ask, otherwise as Follow-up's. It wakes a resting agent only because you asked for it. `start_workspace` runs only after your approval, through a dry run and confirm. The Overseer can't merge, archive or post anywhere.
48
- The Summary keeps its overviews in `plugin-data/follow-up/about.json` (gist, overview, linked rows, when and from what; never raw history) and logs each model call's duration and cost to `ai-jobs.jsonl`. To write one it reads the root agent's latest steps from its live timeline only when Paseo already has the agent loaded; otherwise it reads the first and last part of the agent's provider transcript on disk (Claude Code's `~/.claude/projects`, Codex's `~/.codex/sessions`), read-only, and never wakes the agent. It reads subagent titles from Paseo's agent list, PR titles and bodies with `gh pr view`, and only the Linear issues and Slack threads the workspace itself links, through `mcpproxy call tool-read` (`linear:get_issue`, `slack-user:slack_read_thread`); there are no searches. The model is set under Settings → Agents (default Haiku). With Claude it runs as a headless `claude -p` with no tools, no MCP servers, no settings and no saved session. With Codex it runs as `codex exec --ephemeral` with no user config or rules, no shell tool and a read-only sandbox in an empty temporary folder. Either way it gets one turn, a 90-second timeout, and runs one call at a time; on timeout the whole process group is killed. Overviews are written ahead of time only for non-dormant workspaces in Needs you, at most 60 a day by default (Settings → Agents), and not while a Claude account is above 85% of a limit or the resource governor has paused background work; above its higher threshold, opening the section shows the cached overview and writes none.
49
-
50
- Settings → Agents (`plugin-data/follow-up/agents.json`, its own file) chooses the provider, model, effort and mode for Summaries, the Overseer, recovery agents and the priority ranker. Missing or invalid entries use the defaults. The provider and model list comes from Paseo's provider snapshot. It is read only when that settings screen opens, and cached for ten minutes. A changed Overseer setting is never applied mid-conversation: Home offers a restart, and the new Overseer is handed the old one's last steps (read from its transcript on disk when it isn't loaded). The old agent is left as it is. A recovery agent on a different provider than the main agent keeps the main agent's system prompt, MCP servers and tool policy, and drops its provider-specific model, mode and options. `FOLLOW_UP_OVERSEER_PROVIDER` ("provider/model") overrides the Overseer's setting; it exists only for isolated test daemons.
51
-
52
- The ranker behind AI priority (beta) runs inside Follow-up's worker as bounded one-shot jobs (Claude or Codex, per the ranker role) through the shared job runner (`server/ai-jobs.ts`), one at a time and only while the resource governor allows background work. It reads Follow-up's own state, `mcpproxy call tool-read` for `linear:list_issues` (assigned to you) and `slack-user:slack_search_public_and_private` (DMs and mentions, last 48 hours), `gh search prs --review-requested=@me`, and the planning artifact through one Claude turn limited to the Artifact tool. It hashes those inputs and calls the model only when they changed. It writes only `plugin-data/follow-up/priorities.json` (its ranking, which replaces its previous one) and `ranker.json` (input hash, run count, source health, the day's plan summary, and Linear issues no workspace covers). It never stores raw artifact HTML or share keys. The provider, model, cadence and daily cap come from the ranker role in Settings → Agents; the plan reader always uses Claude, the only provider with the Artifact tool.
53
-
54
- Wait for background jobs (1.4.0-beta.24, folded in from the standalone paseo-wait plugin) attaches `wait_prepare_job`, `wait_for_job` and `wait_get_job` to every interactive Claude session as native plugin tools, with `CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS=0` in that session's environment (Claude Code then never backgrounds a long MCP call, Wait's or another's) and `FOLLOW_UP_WAIT=1`, which makes the provider hook add Wait's guidance once at SessionStart. It keeps job records in `plugin-data/follow-up/wait/jobs/<agentId>/<jobId>/` (`job.json`, a `started` marker and the exit receipt `result.json`) and a shell runner, `wait/run-job.sh`, that the agent's own Bash tool runs; the worker never runs the command. A job is readable only by the agent id and working directory the daemon reports for the caller. A wait holds two timers and refreshes that one agent at most once a second to notice a new message, and only while it waits. It is off when Settings → Agents says so (`enable_wait: false` in `agents.json`), when Paseo's `config.json` lists the standalone `paseo-wait` plugin as installed and not disabled, when the host doesn't serve plugin tools, and for agents labelled `follow-up-wait/enabled=false`, `paseo-wait/enabled=false` or `plugin-tools/enabled=false`. Records are never deleted automatically.
55
-
56
- Getting started keeps only its own progress in `plugin-data/follow-up/onboarding.json`: whether this host was a fresh or existing install when this version first started (existing if `state.json`, `inbox.json`, `reviewers.json`, `agents.json` or `brief.json` was already there), the current step, and whether the existing-install offer was shown or dismissed. An unreadable file counts as finished, so setup is never forced. Its choices are written through the same RPCs and display settings the Settings screen uses. The readiness checks run only when setup asks for them, at most once a minute unless you press Check again: `gh api user` on the daemon host, Paseo's provider snapshot (the same cached read Settings → Agents uses), Paseo's `config.json`, and the count of `hook-state/native-*.json` files. They never read an agent's timeline.
57
-
58
- Updates (Settings → General) talk to the npm registry Paseo itself uses (`npm_config_registry`, else registry.npmjs.org): one abbreviated-metadata request with an ETag about every six hours (none when updates are Off), at most one a minute when Settings opens, one per Check now, and, once per new version, two for its provenance (the version document and its attestations) and one download of its tarball, checked against the confirmed checksum, to show its release notes before installing. Nothing about the host or its agents is sent. Choices, the waiting update and provenance verdicts live in `updates.json`, the last registry answer in `registry.json`, and each install step in `updates.jsonl`. Installing writes `update-watchdog.mjs` and starts it as a detached `node` process with the daemon's connection details in its environment (never on the command line); it previews and applies the update through Paseo's own plugin-update calls, pinned to the checksum Follow-up checked, then reads Paseo's plugin list every 15 seconds and the new worker's `heartbeat.json` for ten minutes, rolls back the same way if needed, and exits. Waiting for a quiet moment uses the cached agent list and turn events, with one fresh agent list right before installing; it never reads timelines.
3
+ **Every agent, one inbox.**
4
+
5
+ Your agents work in parallel. Your attention doesn't. Agent tools are organised around chats: you visit each one to
6
+ find out whether it needs you. Follow-up is a Paseo plugin organised around your attention instead. The work comes to
7
+ you, in one place, ranked.
8
+
9
+ ## What it does
10
+
11
+ - **Every workspace in one place.** All your workspaces, across every project, on one screen, each with its state, a
12
+ one-line summary, and the issues, threads and docs it's about.
13
+ - **One inbox of what needs you, ranked by AI.** Questions, failed checks, reviews and merges from every workspace in
14
+ one list. Agents ask for decisions as cards with lettered options and a recommendation, so you answer in seconds.
15
+ - **Automatic follow-ups, through merge, deploy and after.** Failed checks, conflicts and review comments go back to
16
+ the agent that made the PR. After the merge, its tasks come due when the PR deploys or on a set day.
17
+ - **Dispatch starts new work** from a Linear issue, a link or a sentence: Follow-up makes the workspace, starts the
18
+ agent and tracks it.
19
+ - **Compass ranks by what matters to your team.** Pick the people and sources whose words set your priorities, and
20
+ the morning brief shows what moved.
21
+ - **An Overseer that knows all of it.** Ask one agent with every workspace's context anything from Home's search box.
22
+ It answers, or passes your words to the agent doing the work.
23
+ - **Catch up** after a meeting or a morning away, one card at a time, on the desktop or your phone.
24
+ - **PR statistics** show who opens, merges and reviews PRs, and how long PRs wait for a first review.
25
+ - **Any provider:** agents on Claude Code, Codex, OpenCode, Pi, Copilot, Cursor and more get Follow-up's tools.
26
+
27
+ It never merges, requests reviewers, archives, answers a question for you or wakes a resting agent on its own.
28
+
29
+ ## Install
30
+
31
+ ```sh
32
+ paseo plugin install npm:paseo-follow-up
33
+ ```
34
+
35
+ You need Paseo 0.15 or later and Node 22+ on the machine Paseo runs on. A signed-in GitHub CLI there is optional and
36
+ turns on the PR features. Then open Follow-up in Paseo's sidebar: a two-minute setup walks you through the rest.
37
+
38
+ It runs on your machine with your own sign-ins.
39
+ [What it reads and writes](https://github.com/tomgrin10/paseo-follow-up/blob/main/docs/data-access.md).
package/README.md CHANGED
@@ -96,7 +96,7 @@ I built it for myself, to keep up with my own agents, and it made me a lot more
96
96
  - Answer a question for you.
97
97
  - Wake a resting agent. It reads the transcript on disk instead.
98
98
 
99
- It runs on your machine with your own GitHub sign-in. [OVERVIEW.md](OVERVIEW.md) says exactly what it reads and
99
+ It runs on your machine with your own GitHub sign-in. [Data and access](docs/data-access.md) says exactly what it reads and
100
100
  writes.
101
101
 
102
102
  ## On the pull request, too
@@ -1,11 +1,11 @@
1
- import { createContext, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore, type ReactNode } from "react";
1
+ import { useEffect, useMemo, useRef, useState, useSyncExternalStore, type ReactNode } from "react";
2
2
  import { Image, Platform, Modal as RNModal, View, useWindowDimensions, type ScrollView as NativeScrollView, type StyleProp, type ViewStyle } from "react-native";
3
3
  import { Pressable, Text } from "./text";
4
- import { useRpc } from "@getpaseo/plugin/client";
4
+ import { openExternalUrl, useRpc } from "@getpaseo/plugin/client";
5
5
  import { Icon, Modal, ScrollView } from "@getpaseo/plugin/client/ui";
6
6
  import { useQuery, useQueryClient } from "@tanstack/react-query";
7
7
  import { releaseNotesRpc, whatsNewSeenRpc } from "../shared/contracts";
8
- import { LAST_SEEN_KEY, deviceSeenFrom, inlineRuns, plainInline, recentNotes, whatsNew, type InlineRun, type NoteBlock, type ReleaseNote, type ReleaseNotesView } from "../shared/changelog";
8
+ import { LAST_SEEN_KEY, deviceSeenFrom, inlineRuns, notesFeed, plainInline, whatsNew, type FeedNote, type InlineRun, type NoteBlock, type ReleaseNote, type ReleaseNotesView } from "../shared/changelog";
9
9
  import { deviceStorage, viewStatus } from "../shared/settings-nav";
10
10
  import { useViewVersion } from "./view-store";
11
11
  import { Button, text, type Theme } from "./kit";
@@ -15,27 +15,22 @@ import { NOTES_SCROLL_ATTR, notesScrollbarCss } from "../shared/notes-scrollbar"
15
15
  import { ImageViewer, ImageViewerContext, refocus, useImageViewer, viewerInline, type ViewedImage } from "./image-viewer";
16
16
 
17
17
  /**
18
- * Release notes on the client: What's new after an update, the full list, and Home's quiet version line. The notes
19
- * come from the installed package's CHANGELOG.md through `follow.release-notes`, read once per app session.
18
+ * Release notes on the client: What's new, one scroll of every stable version's notes, shown after an update and from
19
+ * Home's version line and Settings. The notes come from the installed package's CHANGELOG.md through
20
+ * `follow.release-notes`, read once per app session.
20
21
  */
21
22
 
22
23
  export const releaseNotesKey = ["follow-up", "release-notes"];
24
+ /** The updater's view (`client/updates.tsx` reads it); here only for its pending notes. */
25
+ export const updatesKey = ["follow-up", "updates"];
23
26
  export function useReleaseNotes() {
24
27
  const read = useRpc(releaseNotesRpc);
25
28
  return useQuery({ queryKey: releaseNotesKey, queryFn: () => read({}), staleTime: Infinity, retry: 1 });
26
29
  }
27
30
 
28
- const fmtDate = (iso: string | null) => iso ? new Date(`${iso}T12:00:00`).toLocaleDateString(undefined, { day: "numeric", month: "short" }) : null;
31
+ /** A version's date in full, as Paseo's notes write it: "November 26, 2026". */
32
+ const fmtDate = (iso: string | null) => iso ? new Date(`${iso}T12:00:00`).toLocaleDateString(undefined, { day: "numeric", month: "long", year: "numeric" }) : null;
29
33
 
30
- /** Hidden from screen readers: a visual separator only. */
31
- const Dot = ({ style }: { style: object }) => <Text style={style} accessibilityElementsHidden importantForAccessibility="no-hide-descendants" aria-hidden>·</Text>;
32
-
33
- /**
34
- * The text measure in the wide dialog: text lines stop here (about 75 characters) while screenshots use the full
35
- * width. Unset (no cap) in the host's 520px dialog, on phones and in Settings' inline notes.
36
- */
37
- const MeasureContext = createContext<number | undefined>(undefined);
38
- const useMeasure = () => { const m = useContext(MeasureContext); return m ? { maxWidth: m } : null; };
39
34
 
40
35
  /** A line's text with its bold runs semibold (the weight headings use), or the plain text when nothing is bold. */
41
36
  const inline = (line: string, runs?: InlineRun[]): ReactNode =>
@@ -44,7 +39,7 @@ const inline = (line: string, runs?: InlineRun[]): ReactNode =>
44
39
  /** One bullet: a small dot and its text. */
45
40
  function Bullet({ text: line, runs, theme, compact }: { text: string; runs?: InlineRun[]; theme: Theme; compact: boolean }) {
46
41
  const c = theme.colors; const t = text(c, compact);
47
- return <View style={[{ flexDirection: "row", gap: 8 }, useMeasure()]}>
42
+ return <View style={{ flexDirection: "row", gap: 8 }}>
48
43
  <View style={{ width: 4, height: 4, borderRadius: 2, marginTop: compact ? 8 : 7, backgroundColor: c.foregroundMuted }} />
49
44
  <Text style={[t.body, { flex: 1 }]}>{inline(line, runs)}</Text>
50
45
  </View>;
@@ -79,32 +74,32 @@ function NoteImage({ block, theme, compact }: { block: Extract<NoteBlock, { kind
79
74
  }
80
75
 
81
76
  /**
82
- * One version's notes. Shared by What's new, the release notes and Settings. A curated section (headings, paragraphs
83
- * and images, like 2.0.0) reads in full as written: its opening paragraph a step larger as the intro, and whatever
84
- * follows a `---` rule (the credits) as a quiet footnote. A list of bullets folds past `max` behind "Show all N".
77
+ * One version's notes. Shared by What's new and Settings' update card. A curated section (an intro, headings,
78
+ * paragraphs and images, like 2.0.0) reads in full as written, its intro as the first paragraph; whatever follows a
79
+ * `---` rule (the credits) reads as a quiet footnote. Every bullet shows: only a caller that previews a version
80
+ * (Settings' "What's in X", `max`) folds a long list behind "Show all N".
85
81
  */
86
- export function VersionNotes({ note, theme, compact = false, max = 8 }: { note: ReleaseNote; theme: Theme; compact?: boolean; max?: number }) {
82
+ export function VersionNotes({ note, theme, compact = false, max = Infinity }: { note: ReleaseNote; theme: Theme; compact?: boolean; max?: number }) {
87
83
  const c = theme.colors; const t = text(c, compact);
88
84
  const [all, setAll] = useState(false);
89
- const measure = useMeasure();
90
85
  if (note.blocks?.length) {
91
- const lead: object = { fontSize: compact ? 16 : 15, lineHeight: compact ? 24 : 22 };
92
86
  const quietFrom = note.blocks.findIndex(b => b.kind === "rule");
93
87
  // Headings sit a step above body text and closer to the paragraph they open than to the one before.
94
- return <View style={{ gap: 6 }}>
88
+ return <View style={{ gap: 8 }}>
95
89
  {note.blocks.map((b, i) => {
96
90
  const quiet = quietFrom >= 0 && i > quietFrom;
97
91
  if (b.kind === "image") return <NoteImage key={i} block={b} theme={theme} compact={compact} />;
98
92
  if (b.kind === "rule") return <View key={i} style={{ height: 1, backgroundColor: c.border, marginTop: 16, marginBottom: 4 }} />;
99
- // Section headings: semibold, one step above body (body 13/14, heading 15/17, the title role), clearly headings.
100
- if (b.kind === "heading") return <Text key={i} accessibilityRole="header" style={[quiet ? [t.meta, { fontWeight: "600" }] : [t.title, { fontWeight: "600", marginTop: i ? 16 : 0 }], measure]}>{b.text}</Text>;
101
- if (b.kind === "text") return <Text key={i} style={[quiet ? t.meta : i === 0 ? [t.body, lead] : t.body, measure]}>{inline(b.text, b.runs)}</Text>;
93
+ // Section headings: body size, semibold (the label role), so in the feed the version number stays the strongest
94
+ // line and a curated section's headings read as its parts, never as versions of their own.
95
+ if (b.kind === "heading") return <Text key={i} accessibilityRole="header" style={[quiet ? [t.meta, { fontWeight: "600" }] : [t.label, { marginTop: i ? 12 : 0 }]]}>{b.text}</Text>;
96
+ if (b.kind === "text") return <Text key={i} style={[quiet ? t.meta : t.body]}>{inline(b.text, b.runs)}</Text>;
102
97
  return <Bullet key={i} text={b.text} runs={b.runs} theme={theme} compact={compact} />;
103
98
  })}
104
99
  </View>;
105
100
  }
106
101
  const items = all ? note.items : note.items.slice(0, max);
107
- return <View style={{ gap: 6 }}>
102
+ return <View style={{ gap: 8 }}>
108
103
  {items.map((item, i) => { const runs = inlineRuns(item); return <Bullet key={i} text={plainInline(item)} runs={runs.some(r => r.bold) ? runs : undefined} theme={theme} compact={compact} />; })}
109
104
  {!all && note.items.length > max && <Pressable accessibilityRole="button" onPress={() => setAll(true)} hitSlop={compact ? { top: 14, bottom: 14, left: 8, right: 8 } : 6}
110
105
  style={{ minHeight: compact ? 44 : undefined, justifyContent: "center", alignSelf: "flex-start" }}>
@@ -113,53 +108,32 @@ export function VersionNotes({ note, theme, compact = false, max = 8 }: { note:
113
108
  </View>;
114
109
  }
115
110
 
116
- /** "1.4.0-beta.14 · Nov 10", a heading for screen readers. `dateOnly` when the title already names the version. */
117
- function VersionHeader({ note, theme, compact, dateOnly = false }: { note: ReleaseNote; theme: Theme; compact: boolean; dateOnly?: boolean }) {
111
+ /**
112
+ * A version's header row, as Paseo's own What's new draws it: the number on the left, an Installed pill on the one
113
+ * this host runs, the date on the right, and a rule under it. A heading for screen readers ("2.4.1, installed,
114
+ * November 25, 2026"), so they can jump version to version.
115
+ */
116
+ function VersionHeader({ note, theme, compact }: { note: FeedNote; theme: Theme; compact: boolean }) {
118
117
  const c = theme.colors; const t = text(c, compact);
119
118
  const date = fmtDate(note.date);
120
- if (dateOnly) return date ? <Text style={t.meta}>{`Released ${date}`}</Text> : null;
121
- return <View accessibilityRole="header" accessibilityLabel={`${note.version}${date ? `, ${date}` : ""}`} style={{ flexDirection: "row", alignItems: "baseline", gap: 6 }}>
122
- <Text style={[t.label, { fontVariant: ["tabular-nums"] }]}>{note.version}</Text>
123
- {date && <><Dot style={t.meta} /><Text style={t.meta}>{date}</Text></>}
119
+ return <View accessibilityRole="header" accessibilityLabel={[note.version, note.installed ? "installed" : null, date].filter(Boolean).join(", ")}
120
+ style={{ flexDirection: "row", alignItems: "center", gap: 10, paddingBottom: compact ? 10 : 12, borderBottomWidth: 1, borderBottomColor: c.border }}>
121
+ <Text style={{ color: c.foreground, fontSize: compact ? 19 : 18, lineHeight: compact ? 25 : 24, fontWeight: "500", fontVariant: ["tabular-nums"] }}>{note.version}</Text>
122
+ {note.installed && <View style={{ paddingHorizontal: 8, paddingVertical: 1, borderRadius: 999, borderWidth: 1, borderColor: c.border, backgroundColor: c.surface2 }}>
123
+ <Text style={[t.meta, { color: c.foregroundMuted }]}>Installed</Text>
124
+ </View>}
125
+ <View style={{ flex: 1 }} />
126
+ {date && <Text numberOfLines={1} style={[t.meta, { flexShrink: 1 }]}>{date}</Text>}
124
127
  </View>;
125
128
  }
126
129
 
127
- /** An older version, folded to its first note; opens in place. */
128
- function FoldedVersion({ note, theme, compact }: { note: ReleaseNote; theme: Theme; compact: boolean }) {
129
- const c = theme.colors; const t = text(c, compact);
130
- const [open, setOpen] = useState(false);
131
- return <View style={{ borderTopWidth: 1, borderTopColor: c.border }}>
132
- <Pressable accessibilityRole="button" accessibilityState={{ expanded: open }} aria-expanded={open} accessibilityLabel={`${note.version}${note.date ? `, ${fmtDate(note.date)}` : ""}`} onPress={() => setOpen(o => !o)}
133
- // Hover fill only with a pointer; on touch a row would otherwise keep the last tap's fill.
134
- style={state => ({ flexDirection: "row", alignItems: "center", gap: 8, minHeight: compact ? 48 : 36, paddingVertical: 6, marginHorizontal: -8, paddingHorizontal: 8, borderRadius: 6, backgroundColor: state.pressed ? c.surface2 : !compact && (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
135
- <Icon name={open ? "ChevronDown" : "ChevronRight"} size={14} color={c.foregroundMuted} />
136
- <Text accessibilityRole="header" style={[t.label, { fontVariant: ["tabular-nums"], flexShrink: 0 }]}>{note.version}</Text>
137
- {note.date && <Text style={[t.meta, { flexShrink: 0 }]}>{fmtDate(note.date)}</Text>}
138
- {!open && <Text numberOfLines={1} style={[t.meta, { flex: 1, minWidth: 0 }]}>{note.items[0] !== undefined ? plainInline(note.items[0]) : note.blocks?.find(b => b.kind === "text" || b.kind === "bullet")?.text ?? ""}</Text>}
139
- </Pressable>
140
- {open && <View style={{ paddingLeft: 22, paddingBottom: 12 }}><VersionNotes note={note} theme={theme} compact={compact} /></View>}
141
- </View>;
142
- }
143
-
144
- /**
145
- * Newest open, the next ones folded, then "and N older versions" past `cap` (a button only when `onMore` shows them).
146
- * `titled`: the sheet's title already names the newest version, so its header shows just the date.
147
- */
148
- export function NotesList({ notes, theme, compact, cap = 10, onMore, titled = false }: { notes: readonly ReleaseNote[]; theme: Theme; compact: boolean; cap?: number; onMore?: () => void; titled?: boolean }) {
149
- const c = theme.colors; const t = text(c, compact);
150
- const [first, ...rest] = notes;
151
- if (!first) return null;
152
- const shown = rest.slice(0, cap - 1);
153
- const hidden = rest.length - shown.length;
154
- const more = `and ${hidden} older version${hidden === 1 ? "" : "s"}`;
155
- return <View style={{ gap: 0 }}>
156
- <View style={{ gap: 8, paddingBottom: 14 }}><VersionHeader note={first} theme={theme} compact={compact} dateOnly={titled} /><VersionNotes note={first} theme={theme} compact={compact} /></View>
157
- {shown.map(n => <FoldedVersion key={n.version} note={n} theme={theme} compact={compact} />)}
158
- {hidden > 0 && (onMore
159
- ? <Pressable accessibilityRole="button" onPress={onMore} style={{ borderTopWidth: 1, borderTopColor: c.border, minHeight: compact ? 48 : 36, justifyContent: "center" }}>
160
- <Text style={[t.meta, { color: c.foreground, fontWeight: "600" }]}>{more}</Text>
161
- </Pressable>
162
- : <View style={{ borderTopWidth: 1, borderTopColor: c.border, minHeight: compact ? 48 : 36, justifyContent: "center" }}><Text style={t.meta}>{more}</Text></View>)}
130
+ /** Every version in one scroll, newest first: each one's header and its notes, nothing folded. */
131
+ export function NotesFeed({ feed, theme, compact }: { feed: readonly FeedNote[]; theme: Theme; compact: boolean }) {
132
+ return <View style={{ gap: compact ? 32 : 36 }}>
133
+ {feed.map(n => <View key={n.version} style={{ gap: compact ? 14 : 16 }}>
134
+ <VersionHeader note={n} theme={theme} compact={compact} />
135
+ <VersionNotes note={n} theme={theme} compact={compact} />
136
+ </View>)}
163
137
  </View>;
164
138
  }
165
139
 
@@ -185,39 +159,49 @@ function NotesScroll({ theme, style, contentContainerStyle, children }: { theme:
185
159
  }
186
160
 
187
161
  /**
188
- * The notes' titles name the plugin, from its manifest (the view's `name`): "What's new in Follow-up 2.0.0", and
189
- * "Follow-up release notes" for every version. Exported for the tests.
162
+ * What's new and the release notes are one view, so one title, naming the plugin from its manifest (the view's
163
+ * `name`): "What's new in Follow-up". Exported for the tests.
190
164
  */
191
- export const notesTitle = (name: string, version: string | null) => version ? `What's new in ${name} ${version}` : `${name} release notes`;
165
+ export const notesTitle = (name: string) => `What's new in ${name}`;
166
+ /** The release pages, from the header's open-in-browser icon: the one URL the notes open (a screenshot never does). */
167
+ const openReleases = (url: string) => { void openExternalUrl(url).catch(() => undefined); };
192
168
 
193
169
  /** The host sheet's own inset on the phone, so our body lines up with its title. */
194
170
  const SHEET_INSET = 24;
195
171
  /**
196
- * From this window width the notes get a wider dialog of their own: the host's Modal is 520px wide with no way to
197
- * widen it, which leaves Home's screenshot at under half its size on a large screen. Below it, the host's dialog.
172
+ * Desktop draws the notes in a dialog of our own, so its header can carry the open-in-browser icon beside the X (the
173
+ * host's Modal has a title and nothing else). The dialog is as wide as the reading column plus its inset, and nothing
174
+ * inside caps itself: text, version rules, dates, screenshots, the credits' rule and the header's icons all share one
175
+ * right edge (2026-11-26: an 840px dialog capped only its text at 600px, leaving a dead band right of every line, the
176
+ * rules and icons past it). A screenshot shows larger in the image viewer.
198
177
  */
199
- const WIDE_FROM = 1280; const WIDE_CARD = 840; const TEXT_MEASURE = 600;
178
+ const NOTES_COLUMN = 600; const DIALOG_INSET = 24;
200
179
 
201
180
  /**
202
- * The wide dialog, drawn like the host's (same dim, card, header and X) so the two widths read as one dialog.
203
- * `onDismiss` is the notes' own close: Esc, the dim and the X all go through it.
181
+ * The desktop dialog, drawn like the host's (same dim, card and X) with Paseo's What's new header: a gift, the title,
182
+ * the release pages and Close. `onDismiss` is the notes' own close: Esc, the dim and the X all go through it.
204
183
  */
205
- function WideDialog({ title, open, onDismiss, theme, width, children, overlay }: { title: string; open: boolean; onDismiss: () => void; theme: Theme; width: number; children: ReactNode; overlay?: ReactNode }) {
184
+ function NotesDialog({ title, open, onDismiss, theme, width, releases, openUrl, children, overlay }: { title: string; open: boolean; onDismiss: () => void; theme: Theme; width: number; releases: string | null; openUrl: (url: string) => void; children: ReactNode; overlay?: ReactNode }) {
206
185
  const c = theme.colors;
207
186
  const reduced = useReducedMotion();
208
187
  const close = useRef<View>(null);
209
188
  useEffect(() => { if (open) (close.current as unknown as { focus?: () => void } | null)?.focus?.(); }, [open]);
189
+ const headerButton = (state: { hovered?: boolean }) => ({ padding: 8, borderRadius: 8, backgroundColor: state.hovered ? c.surface1 : "transparent" });
210
190
  return <RNModal transparent visible={open} animationType={reduced ? "none" : "fade"} onRequestClose={onDismiss}>
211
191
  <View style={{ flex: 1, alignItems: "center", justifyContent: "center", padding: 24, backgroundColor: "rgba(0,0,0,0.55)" }}>
212
192
  <Pressable accessible={false} focusable={false} importantForAccessibility="no" onPress={onDismiss} style={{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }} />
213
193
  <View role="dialog" aria-modal aria-label={title} style={{ width, maxHeight: "85%", flexShrink: 1, minHeight: 0, overflow: "hidden", backgroundColor: c.surface0, borderRadius: 12, borderWidth: 1, borderColor: c.surface2 }}>
214
- <View style={{ flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: 24, paddingVertical: 16, borderBottomWidth: 1, borderBottomColor: c.surface2 }}>
194
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 10, paddingLeft: DIALOG_INSET, paddingRight: DIALOG_INSET - 8, paddingVertical: 14, borderBottomWidth: 1, borderBottomColor: c.surface2 }}>
195
+ <Icon name="Gift" size={16} color={c.foregroundMuted} />
215
196
  <Text role="heading" numberOfLines={1} style={{ flex: 1, minWidth: 0, color: c.foreground, fontSize: 14, fontWeight: "500" }}>{title}</Text>
216
- <Pressable ref={close} accessibilityRole="button" accessibilityLabel="Close" onPress={onDismiss} style={state => ({ padding: 8, marginRight: -8, borderRadius: 8, backgroundColor: (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
197
+ {releases && <Pressable accessibilityRole="link" accessibilityLabel="Release notes on GitHub" accessibilityHint="Every version's full changelog, in your browser" onPress={() => openUrl(releases)} style={state => headerButton(state as { hovered?: boolean })}>
198
+ {state => <Icon name="ExternalLink" size={16} color={state.pressed ? c.foreground : c.foregroundMuted} />}
199
+ </Pressable>}
200
+ <Pressable ref={close} accessibilityRole="button" accessibilityLabel="Close" onPress={onDismiss} style={state => headerButton(state as { hovered?: boolean })}>
217
201
  {state => <Icon name="X" size={16} color={state.pressed ? c.foreground : c.foregroundMuted} />}
218
202
  </Pressable>
219
203
  </View>
220
- <NotesScroll theme={theme} style={{ flexShrink: 1, minHeight: 0 }} contentContainerStyle={{ paddingHorizontal: 24, paddingTop: 16, paddingBottom: 16, gap: 12 }}>{children}</NotesScroll>
204
+ <NotesScroll theme={theme} style={{ flexShrink: 1, minHeight: 0 }} contentContainerStyle={{ paddingHorizontal: DIALOG_INSET, paddingTop: 24, paddingBottom: 32 }}>{children}</NotesScroll>
221
205
  </View>
222
206
  {overlay}
223
207
  </View>
@@ -225,57 +209,46 @@ function WideDialog({ title, open, onDismiss, theme, width, children, overlay }:
225
209
  }
226
210
 
227
211
  /**
228
- * "What's new in X": the host's dialog on desktop (a wider one of ours from 1280px windows), its sheet on the phone.
229
- * On the phone our own scroll body with a pinned footer, so Close stays in thumb reach however long the notes are.
230
- * "See all release notes" switches the same sheet to every version, so nothing navigates away from under it. A tapped
231
- * screenshot opens the image viewer over the notes; Esc or a click closes the viewer first, then the notes.
212
+ * "What's new in X": every stable version's notes in one scroll, newest first, like Paseo's own (invariant 120,
213
+ * `notes-read-like-one-feed`). It always opens at the top, the newest version; older ones are a scroll away, never a
214
+ * fold or a second view. Desktop: our dialog, with the release pages (each version's full changelog) behind the
215
+ * header's open-in-browser icon. Phone: the host's sheet with our scroll body and a pinned footer, so Close and the
216
+ * release pages stay in thumb reach however long the notes are. A tapped screenshot opens the image viewer over the
217
+ * notes; Esc or a click closes the viewer first, then the notes.
232
218
  */
233
- export function WhatsNewSheet({ open, name, notes, all, theme, compact, onClose, startAll = false }: { open: boolean; name: string; notes: readonly ReleaseNote[]; all: readonly ReleaseNote[]; theme: Theme; compact: boolean; onClose: () => void; startAll?: boolean }) {
234
- const c = theme.colors; const t = text(c, compact);
235
- const [full, setFull] = useState(startAll);
219
+ export function WhatsNewSheet({ open, name, feed, releases, theme, compact, onClose, openUrl = openReleases }: { open: boolean; name: string; feed: readonly FeedNote[]; releases: string | null; theme: Theme; compact: boolean; onClose: () => void; openUrl?: (url: string) => void }) {
220
+ const c = theme.colors;
236
221
  const [viewing, setViewing] = useState<{ image: ViewedImage; from: unknown } | null>(null);
237
222
  const win = useWindowDimensions();
238
- const list = full ? all : notes;
239
- const newest = list[0];
240
- if (!newest) return null;
241
- const wide = !compact && win.width >= WIDE_FROM;
223
+ if (!feed.length) return null;
242
224
  const closeViewer = () => { const from = viewing?.from; setViewing(null); refocus(from); };
243
225
  const dismiss = () => { if (viewing) closeViewer(); else onClose(); };
244
- const meta = !full && list.length > 1 ? `${list.length} versions since you last looked` : null;
245
- const body = <>
246
- {meta && <Text style={t.meta}>{meta}</Text>}
247
- <NotesList notes={list} theme={theme} compact={compact} cap={full ? all.length : 10} onMore={full ? undefined : () => setFull(true)} titled={!full} />
248
- </>;
249
- const footer = (pinned: boolean) => <View style={{ borderTopWidth: 1, borderTopColor: c.border, flexDirection: compact ? "column" : "row", alignItems: compact ? "stretch" : "center", justifyContent: full ? "flex-end" : "space-between", gap: compact ? 4 : 8,
250
- ...(pinned ? { backgroundColor: c.surface1, paddingHorizontal: SHEET_INSET - 8, paddingTop: 8, paddingBottom: 12 } : { paddingTop: 12, marginTop: 4 }) }}>
251
- {!full && all.length > list.length && <Button title="See all release notes" kind="ghost" theme={theme} compact={compact} grow={compact} onPress={() => setFull(true)} />}
252
- <Button title="Close" kind="secondary" theme={theme} compact={compact} grow={compact} onPress={onClose} />
253
- </View>;
254
226
  const viewer = viewing && <ImageViewer image={viewing.image} inline={viewerInline(compact)} onClose={closeViewer} />;
255
- const provide = (children: ReactNode) => <ImageViewerContext.Provider value={(image, from) => setViewing({ image, from })}>
256
- <MeasureContext.Provider value={wide ? TEXT_MEASURE : undefined}>{children}</MeasureContext.Provider>
227
+ const body = <ImageViewerContext.Provider value={(image, from) => setViewing({ image, from })}>
228
+ <NotesFeed feed={feed} theme={theme} compact={compact} />
257
229
  </ImageViewerContext.Provider>;
258
- const title = notesTitle(name, full ? null : newest.version);
230
+ const title = notesTitle(name);
259
231
  // The viewer always sits outside the scroll view: react-native-web's ScrollView sets translateZ(0), which would trap
260
232
  // the viewer's fixed position inside the dialog.
261
- if (wide) return <WideDialog title={title} open={open} onDismiss={dismiss} theme={theme} width={Math.min(WIDE_CARD, win.width - 96)} overlay={viewer}>
262
- {provide(<>{body}{footer(false)}</>)}
263
- </WideDialog>;
233
+ if (!compact) return <NotesDialog title={title} open={open} onDismiss={dismiss} theme={theme} releases={releases} openUrl={openUrl}
234
+ width={Math.min(NOTES_COLUMN + 2 * DIALOG_INSET, win.width - 48)} overlay={viewer}>{body}</NotesDialog>;
264
235
  return <Modal title={title} open={open} onOpenChange={next => { if (!next) dismiss(); }}>
265
- {compact
266
- ? <Modal.Content scrollable={false} contentContainerStyle={{ padding: 0, gap: 0 }} style={{ flex: 1 }}>
267
- <NotesScroll theme={theme} style={{ flex: 1 }} contentContainerStyle={{ paddingHorizontal: SHEET_INSET, paddingTop: 12, paddingBottom: 16, gap: 12 }}>{provide(body)}</NotesScroll>
268
- {footer(true)}{viewer}
269
- </Modal.Content>
270
- // Desktop: the host's dialog at its 85% height with our own scroll body, so the viewer can sit outside it; Esc and
271
- // the X close it too (the viewer first).
272
- : <Modal.Content scrollable={false} contentContainerStyle={{ padding: 0, gap: 0 }} style={{ flex: 1 }}>
273
- <NotesScroll theme={theme} style={{ flex: 1 }} contentContainerStyle={{ paddingHorizontal: 20, paddingTop: 4, paddingBottom: 16, gap: 12 }}>{provide(<>{body}{footer(false)}</>)}</NotesScroll>
274
- {viewer}
275
- </Modal.Content>}
236
+ <Modal.Content scrollable={false} contentContainerStyle={{ padding: 0, gap: 0 }} style={{ flex: 1 }}>
237
+ <NotesScroll theme={theme} style={{ flex: 1 }} contentContainerStyle={{ paddingHorizontal: SHEET_INSET, paddingTop: 16, paddingBottom: 24 }}>{body}</NotesScroll>
238
+ <View style={{ borderTopWidth: 1, borderTopColor: c.border, flexDirection: "row", alignItems: "center", gap: 8, backgroundColor: c.surface1, paddingHorizontal: SHEET_INSET - 8, paddingTop: 8, paddingBottom: 12 }}>
239
+ {releases && <Button title="On GitHub" icon="ExternalLink" kind="ghost" theme={theme} compact accessibilityLabel="Release notes on GitHub" accessibilityHint="Every version's full changelog, in your browser" onPress={() => openUrl(releases)} />}
240
+ <Button title="Close" kind="secondary" theme={theme} compact grow onPress={onClose} />
241
+ </View>
242
+ {viewer}
243
+ </Modal.Content>
276
244
  </Modal>;
277
245
  }
278
246
 
247
+ /** Notes for versions out but not installed, from the updater's view when it has been read (never fetched for this). */
248
+ function usePendingNotes(): readonly ReleaseNote[] {
249
+ return useQueryClient().getQueryData<{ pendingNotes?: ReleaseNote[] }>(updatesKey)?.pendingNotes ?? [];
250
+ }
251
+
279
252
  /**
280
253
  * Where "seen" lives: per device, in the device document on 0.16 (the phone included), else localStorage on web and
281
254
  * desktop. A native app without either falls back to the host's record: What's new then shows once per host there,
@@ -304,6 +277,7 @@ export function WhatsNewGate({ surface, theme, compact }: { surface: string; the
304
277
  const onboarding = ob.isPending || !!ob.data?.show;
305
278
  const owner = useSyncExternalStore(subscribeClaim, claimVersion, claimVersion);
306
279
  const seen = useRpc(whatsNewSeenRpc); const cache = useQueryClient();
280
+ const pending = usePendingNotes();
307
281
  const [closed, setClosed] = useState(false);
308
282
  const view = query.data;
309
283
  const viewVersion = useViewVersion();
@@ -322,12 +296,13 @@ export function WhatsNewGate({ surface, theme, compact }: { surface: string; the
322
296
  deviceStorage.set(LAST_SEEN_KEY, view.version); setClosed(true);
323
297
  void seen({ version: view.version }).then(v => cache.setQueryData(releaseNotesKey, v), () => undefined);
324
298
  };
325
- return <WhatsNewSheet open name={view.name} notes={decision.notes} all={view.notes} theme={theme} compact={compact} onClose={close} />;
299
+ return <WhatsNewSheet open name={view.name} feed={notesFeed(view.notes, view.version, pending)} releases={view.releases} theme={theme} compact={compact} onClose={close} />;
326
300
  }
327
301
 
328
- /** What's new opened by hand (Home's footer): since the previous version, or every version with `all`. */
329
- export function ReleaseNotesSheet({ theme, compact, all = false, onClose }: { theme: Theme; compact: boolean; all?: boolean; onClose: () => void }) {
302
+ /** What's new opened by hand (Home's version line, Settings → General): the same scroll, opened at the newest version. */
303
+ export function ReleaseNotesSheet({ theme, compact, onClose }: { theme: Theme; compact: boolean; onClose: () => void }) {
330
304
  const view = useReleaseNotes().data;
305
+ const pending = usePendingNotes();
331
306
  if (!view) return null;
332
- return <WhatsNewSheet open name={view.name} notes={recentNotes(view)} all={view.notes} startAll={all} theme={theme} compact={compact} onClose={onClose} />;
307
+ return <WhatsNewSheet open name={view.name} feed={notesFeed(view.notes, view.version, pending)} releases={view.releases} theme={theme} compact={compact} onClose={onClose} />;
333
308
  }