Skip to content

feat(portal): All patches lists every patch, with tabs and search - #715

Merged
allisonmahmood merged 2 commits into
mainfrom
portal/709-all-patches
Oct 16, 2026
Merged

allisonmahmood merged 2 commits into
mainfrom
portal/709-all-patches

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #713 (it reads the visit count #713 adds to ReadPatch). It can ship once #713 is in.

Home (#707) moves managing off /, and it needs somewhere to go: one list of every patch an owner or admin can act on, and one place a member can browse everything. Today the only list is the index beside the card: alphabetical, with no search, and with retired and deleted patches behind a toggle.

Fix

  • /patches, All patches. A table of every patch the viewer can open, in tabs over ?show= like the Company page's:

    • All (live), Tools (tier 1 and 2), Pages (tier 0), Yours, Needs attention, Retired and deleted;
    • Needs attention and Retired and deleted appear only when they hold something.

    ?q= searches the current tab by name, title, description and owner. Columns: the patch's mark, name, first clause and You/New tags; owner; vN · ago; visits; who can open it; and a row menu. Pages and Retired and deleted sort newest first, the rest by visits.

  • Row menus. Members get Open, Copy link and About this patch. Owners also get Settings (the card until feat(portal): the card splits into Overview, Log, Versions and Settings #711) and Retire… and Delete… on live rows, or Restore and Delete… on off ones. Admins also get Reassign…, deleted rows included. Every item goes to the route that already does it. Restore posts the same form as the card's inline Restore. An expired deletion the sweep hasn't reclaimed yet says "Recovery ended" and offers no Restore.

  • Needs attention lists a patch only to its owner and to admins, with the act that resolves it:

    • admins see every patch whose owner is deactivated, in any state, with Reassign…;
    • both see deletions with now < purgeAt ≤ now + 7 days, with Restore.

    A member who owns nothing never sees the tab, and ?show=attention shows them nothing.

  • Components. The portal is the Company page's second user of avatar, the row menu and the search field. These move into @patchy/core as avatar, rowMenu, menuLink, menuPost and searchField, plus menuCopy, a Copy item the existing copy script reveals. New marks: mono, a tool's two letters tinted from its name, and page-mark, a tier 0 page's ruled sheet, both via patchMark(name, tier).

  • The old index links to All patches, so it's reachable before Home lands (feat(portal): Home replaces the index #710). /patches is served by the existing /patches/* wildcard, which FindMyWay would not let a separate route share.

  • patches joins the reserved company handles: /patches/<name> already shadowed a company with that handle.

Verified

  • PortalPages.test.ts, new "all patches" block:
    • tabs list exactly their patches, in visits order;
    • search narrows within a tab (and by owner name), and tab links keep it;
    • a description holding <script> renders escaped;
    • the off tab says who retired it and how long a deletion has left;
    • row menus hold exactly each role's acts;
    • Needs attention appears for an owner's deleted-soon patch and an admin's orphaned one, never for a member of another company, and loses Restore once recovery ends.
  • In the browser, pnpm dev up brightline as Allison: tabs, marks, page mark, avatars and menus render with no console errors.
  • pnpm check: format, lint, typecheck and synth pass. Three unrelated suites (PgliteCompanyDatabases, cliRepoBuild, SdkApi) timed out under a machine load average of about 25 and passed when rerun alone.

Release impact

  • Breaking
  • Not breaking: a new page and a link to it. Reserving patches refuses that handle only for new companies.

Surfaces

  • Served pages. A new app-shell page composing shell components; page CSS is layout only. ui-consistency lists the moved and new components.
  • Vocabulary. Portal glossary: All patches. GLOSSARY-MAP.md's Portal line.
  • Reverse states. Every act in the menus leads to its existing way back (Restore, Reassign).
  • Wire contract, CLI, dev loop, migrations and repo layout: not touched.

Part of #707. Closes #709.

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

@github-actions github-actions Bot added area:server Touches the server area area:core Touches the core area area:docs Touches the docs area area:ui Portal and first-party browser pages, shared rendering and styles size:l 501-1,000 changed lines labels Oct 15, 2026
@allisonmahmood allisonmahmood mentioned this pull request Oct 15, 2026
1 of 2 tasks
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review: GPT 6.1 Sol, xhigh, round 1. Six findings, all fixed in the commit after dbd5410.

  1. Needs attention skipped retired and deleted patches whose owner is deactivated. Admins now see an orphan in any state. A deletion within a week of reclamation still takes precedence, since it's the more urgent reason.
  2. No Reassign… on deleted rows. The routes support it, so admins now get it.
  3. No Settings item. Owners and admins now get one, pointing at the card until feat(portal): the card splits into Overview, Log, Versions and Settings #711 adds the tab.
  4. The hidden Copy item still showed. .menu-item { display: flex } overrode hidden. The shell now has .menu-item[hidden] { display: none }, so a menu without script offers only what works.
  5. The permission test proved little. It now uses a same-company admin's deletion, which the owner must not see, plus orphans in two states and a reassignment that moves who sees a row, and it checks tab counts.
  6. Search icon spacing lived in page CSS. It moves into the shell as field-search, and both page overrides are gone.

Portal, companies, auth and core suites pass (312 tests); lint and typecheck pass.

allisonmahmood and others added 2 commits October 16, 2026 02:48
/patches is a table of every patch the viewer can open, in tabs for
All, Tools, Pages, Yours, Needs attention and Retired and deleted, with
a search over name, title, description and owner and each row's acts in
its menu. Needs attention lists a patch only to its owner and admins.
The Company page's avatar, row menu and search field move into core's
component set beside two new marks, mono and page-mark. "patches" joins
the reserved company handles.

Part of #707. Closes #709.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Needs attention listed only live patches with a deactivated owner;
admins now see one in any state, and a deletion near reclamation comes
first. Admins get Reassign… on deleted rows, and owners and admins a
Settings item. A Copy item waiting for the copy script was still shown,
since .menu-item set display: flex over hidden. The search icon's gap
moves into the shell as field-search.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood merged commit b25419d into main Oct 16, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the portal/709-all-patches branch October 16, 2026 01:04
allisonmahmood added a commit that referenced this pull request Oct 16, 2026
Stacked on #715. It can ship once #713 and #715 are in.

The signed-in landing at `/` was an alphabetical index beside one
patch's whole management card, so the page people visit most was laid
out for managing one patch. Opening a tool meant finding its row and
then pressing Open. Tier 0 reports buried the tools people use daily.
Anyone who owned no patch landed on the first-patch guide on every
visit.

## Fix

`/` is now **Home**, for opening patches rather than managing them
(`packages/portal/src/home.ts`):

- **Search** over every live patch's name, title, description and owner,
applied before any shelf limit. Matches are marked, with totals and "All
N matching" links to All patches that carry the query. A search that
matches nothing offers `Build us a Patchy tool for <query>` as a copy
line for an agent, a link to the guide for someone who owns nothing, and
a link to search retired and deleted patches.
- **Your usual**: the four live patches the viewer opened in the last 30
days with the highest opens score (#713), ties by name. Missing slots
are padded from the company's most-visited patches, each saying "Popular
at …". With no opens yet, the shelf is titled "Popular at …". A tile
opens the patch itself; its menu holds About this patch, Open in a new
tab and Copy link.
- **Tools** (tiers 1 and 2): the viewer's own first, then by the
viewer's score and the company's visits, up to twelve. While the viewer
owns no patch, a dashed **Make your own** row leads to the guide.
- **Pages** (tier 0): up to three **New to you** and three **Latest**.
New to you is a colleague's company-scope page published in the last
week that the viewer hasn't opened since. A public page never claims to
be unread, since opening it records nothing.
- The guide moves to **`/guide`**, which redirects an owner Home. With
nothing live and nothing of the viewer's own, Home is the guide, as
before. An owner whose patches are all off sees "Nothing is live" and a
link to them. "Your first patch is live" sits at the top of Home for its
day. The guide's copy now says "It shows up on your Home".
- **The card** at `/patches/<name>` renders alone, full width. The
index, its toggle and the guide's index row are gone. #711 splits the
card into tabs.
- **Shell components**: `tile` (a card to open, with its corner menu),
`tile-row` (compact), `tile-row-plain` (in a list),
`tile-row-placeholder`, `mono-placeholder` and `mark`. The What's new
dot marks a page new to you.

## Verified

- `PortalPages.test.ts`: the five tests that pinned the index are
rewritten for Home, and new ones cover:
- Your usual comes only from the viewer's own opens in 30 days, ordered
by score, and another member's opens never move it;
  - a rename keeps the opens, and a retired patch leaves every shelf;
- the viewer's own tools come first, and a republish at tier 1 moves a
page into Tools;
- New to you lists only a colleague's company page published this week,
and drops it once opened or rolled back;
- search counts and lists past the shelf limits, finds by title and
owner, and escapes a miss in its text, its copy line and its links;
- Make your own lasts until the first publish, `/guide` then redirects,
and the first-patch note lasts a day;
  - empty company and off-only owner;
  - `/?all=1` still answers.
- In the browser, `pnpm dev up brightline` with five extra pages and
Sofia's opens recorded by `pnpm dev shot`: Home, a search with no match
and All patches render with no console errors.
- `pnpm check`: format, lint, typecheck and synth pass.
`cliRepoBuild.test.ts` timed out once under load from other worktrees
(load average about 18) and passes alone.

## Release impact

- [ ] **Breaking**
- [x] **Not breaking**: the portal's own pages change; `/patches/<name>`
and every form keep their routes and fields, and `?all=1` links still
answer.

## Surfaces

- **Served pages.** Home, `/guide` and the card compose shell
components; page CSS is layout only. `ui-consistency` lists the new tile
components.
- **Vocabulary.** Portal glossary: **Portal** rewritten; **Home**,
**Your usual**, **Tools** and **Pages** added; **Guide** updated;
**Index** retired. `GLOSSARY-MAP.md`'s Portal line. `docs/product.md`'s
portal paragraph.
- **Dev loop.** `docs/DEVELOPMENT.md`'s portal exercise now covers Home,
search, `/patches` and `/guide`, and how `pnpm dev shot` records an
open.
- **Reverse states.** Retired and deleted patches stay one link from
Home. The guide stays reachable at `/guide` until the first publish.
- Wire contract, CLI, skills, migrations and repo layout: not touched.

Part of #707. Closes #710.

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
allisonmahmood added a commit that referenced this pull request Oct 16, 2026
…gs (#717)

Stacked on #716. It can ship once #713, #715 and #716 are in.

With the index gone (#716), the card at `/patches/<name>` was still
today's single long page: facts, a Manage section with the description
and sharing forms, a four-row versions table, and Retire and Delete at
the bottom. Open was one button among many, and tier 3's triggers block
(#640) would have crowded it further.

## Fix

- **Header.** Breadcrumb Home / All patches / name, the patch's mark,
name, title line and tags (Tool or Page, Company only or Public, `vN`,
Retired or Deleted). Then the one act that matters most: Open on a live
patch, or the existing Restore control for a manager while an off patch
can be restored. The copyable address sits under it.
- **Tabs.** Everyone gets **Overview** and **Versions**. The owner and
admins also get **Log** and **Settings**.
- **Overview:** the description and editor, the facts (now with visits),
an off patch's note and restore hint, the admin's deactivated-owner
warning, and recent activity.
- **Versions** (`/versions`): every version, with rollback for managers.
It replaces the card's four-row table.
  - **Log** (`/log`): the existing log, inside the frame.
- **Settings** (`/settings`, new): the old Manage section. Owner with
admin-only Reassign…, the description and who-can-open forms, then Stop
serving (Retire…, Delete…) or, for a retired patch, Delete….
- **Forms keep their routes, fields and checks.** A success redirects to
the tab the form sits on: description and scope to Settings, rollback to
Versions, the confirmation acts to Overview. Refusals:
- a member's POST, or a missing or mismatched `expectedPatchId`
(including a name that now names another patch), renders Overview with
the notice and never another patch's forms;
- a permitted description, scope or rollback refused as stale, invalid
or wrong-state renders that form's tab, keeping the submitted
description;
  - confirmation acts behave as before.

A member's GET of Settings renders Overview with a 403 notice, as the
log already did.
- The Settings items in All patches' menus and on Home's tiles now link
to `/settings`.
- **`?all=1` is gone.** It only toggled the index's retired rows. Links
no longer carry it, and requests that do are answered as if they didn't.

## Verified

- `PortalPages.test.ts`:
- the card tests now check each role's tabs, a member's 403 on Settings,
the forms on Settings and Versions (every non-current version is offered
for rollback), and Restore leading an off card;
  - redirects land on Settings or Versions;
- the stale, invalid and name-moved refusal tests read their forms from
the right tab and still answer the same status and notice;
  - 88 portal tests pass.
- In the browser, `pnpm dev up brightline` as Allison: Overview,
Settings and Log for `new-business` render with no console errors.
- `pnpm check`: format, lint, typecheck and synth pass.
`cliRepoBuild.test.ts` timed out once under load and passes in CI on
#715 and #716 and alone.

## Release impact

- [ ] **Breaking**
- [x] **Not breaking**: every route and form field is unchanged, plus
one new GET route (`/settings`). Old `?all=1` links still answer.

## Surfaces

- **Served pages.** The card composes shell components (`tabs`, `tag`,
the mark, `note`, fields). Page CSS is layout only.
- **Vocabulary.** Portal glossary: **Card** (its tabs), **Log** (a tab),
**Settings** replaces **Manage**. `GLOSSARY-MAP.md`'s Portal line.
`docs/product.md`'s card sentences.
- **Reverse states.** Restore leads every restorable off card, and
Retire, Delete and Reassign keep their confirmation pages.
- Wire contract, CLI, migrations and repo layout: not touched.
Off-address notices still link to the card and its restore route.

Part of #707. Closes #711.

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
allisonmahmood added a commit that referenced this pull request Oct 16, 2026
Stacked on #717. It can ship once #713, #715, #716 and #717 are in; the
rest of the stack is complete without it.

When an owner's tier 2 tool starts failing, they don't find out unless
they open its log. An admin tidying the company can't see which tools
are broken either.

## Fix

- **`InvocationLog.failures({ companyId, since })`.** Per patch, the
number of top-level entries started since `since` whose effective
outcome is one the log's **Failed** filter shows. It reuses the filter's
own outcome expression, now named `failed`: commit proof reads as
success, an overdue pending entry reads as unknown, and unknown isn't a
failure. One grouped query over a new partial index,
`runtime_invocations_top_level_recent (company_id, started_at) WHERE
parent_id IS NULL` (migration `0018`, after #713's `0017`).
- **Who sees it.** Only the tier 2 patches the viewer manages (the
owner, or any patch for admins). A member who manages none never queries
the log.
- **All patches.** A **Health** column (`OK`, or `N failed` linking to
the log filtered to Failed), and the Needs attention reason "N calls
failed in the last day" with a See the log button. A deletion near
reclamation and a deactivated owner still come first.
- **Home.** An owner's own failing tools are named at the top, each with
its count and a link to its failed entries. Admins see everyone's in All
patches, not on Home.
- `patchy dev`'s stub `InvocationLog` answers `failures` with nothing,
like its other reads.

## Verified

- `InvocationLog.test.ts`: two failed top-level entries of the last day
count. An entry 25 hours old, an overdue pending one, a nested failure
and a success don't. The Failed filter lists the same entries plus the
older one.
- `PortalPages.test.ts`, "patch health": three failures today and one
two days ago show as 3 in the owner's Home warning, linked to
`log?outcome=failed`, and not on a member's or an admin's Home. Owner
and admin see Health (`3 failed`, `OK`) and the Needs attention reason.
A member sees no Health column, no counts and no Needs attention tab.
- `pnpm check`: format, lint, typecheck and synth pass.
`cliRepoBuild.test.ts` timed out under local load, as on the PRs below,
where CI passes it.

## Release impact

- [ ] **Breaking**
- [x] **Not breaking**: one read added to the log service and to the
portal's pages, plus one additive index; no wire or CLI change.

## Surfaces

- **Migrations.** `0018_invocations_top_level_recent` in Runtime's
migrations. It takes the next id after #713's `0017`; if another
migration lands first, renumber it.
- **Vocabulary.** Portal glossary: **All patches** (Health) and **Home**
(the owner's warning). `docs/product.md`'s portal paragraph.
- **Served pages.** Composes `note`, `pill` and `list`; no new
component.
- Wire contract, CLI, migrations, dev loop and repo layout: not touched.

Part of #707. Closes #712.

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
allisonmahmood added a commit that referenced this pull request Oct 16, 2026
…u when they fail (#720)

Release 13's What's new entry, written from `c9b8fc4`, ahead of
deploying it. `patchy` and `CURRENT_RELEASE` move to `0.13.0`, so CLIs
and patch repos installed before this deploy are told to upgrade.

| Change | PRs |
| --- | --- |
| New: Home puts the patches you use first | #713, #716, #719 |
| New: Every patch in one list | #715 |
| Improved: Each patch's page leads with Open | #717 |
| New: See when your tools are failing | #718 |
| Fixed: Everyone has a name | #687 |
| Improved: Your company's look is easier to get right | #697, #696,
#703, #688 |
| Improved: Forms follow your look's error states | #691, #692 |
| Improved: Clearer answers when a publish goes wrong | #686, #685, #689
|
| Fixed: Your agent's Patchy commands are steadier | #695, #704, #680,
#681 |
| Behind the scenes: stricter checks on static pages and tools' database
requests; malformed requests are logged | #682, #693, #683 |
| Behind the scenes: usage numbers count every publish, sharing change
and restore | #698, #699, #700, #690 |
| Test and tooling only, no line | #705, #702, #701, #694, #684, #607 |

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Touches the core area area:docs Touches the docs area area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:l 501-1,000 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(portal): All patches lists every patch, with tabs and search

1 participant