Repository navigation
fix(serving): Patchy gets a favicon and patch tabs show the patch's title - #660
Conversation
…itle Every Patchy page and patch tab shows the patchyhq.com mark, inlined as a data: URL; the scripted shell's policy admits data: images for it. Tier 1 and 2 publish and `patchy dev` take the tab title from the page's <title>, as tier 0 already did, and init starts that title from the patch's name. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…llback Review found the title walk recursed (deep markup threw), a near-cap bundle took ~650 ms to parse on every publish and dev shell load, an empty first <title> fell through to the next one, and rollback kept the newer version's title. The title now comes from the first 512 KiB, walked iteratively; tier 0 shares the same rule; patchy dev reads it once per build; rollback restores the title the version published with. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GPT 6.1 Sol review, round 11. should-fix: the title walk recursed, so deep markup threw ( 2. should-fix: 3. should-fix: rollback kept the newer version's title. Fixed: rollback sets the title from the target version's stored publish response. That also fixes the same existing gap for tier 0. The new publish test rolls back to v1 and fails without the fix. Not changed: a historical address ( 4. nit: an empty first Not in this PR:
|
…e name Review found a title cut at the read limit could publish truncated (`Fish &am`). A cut document now counts only a title whose end tag survived. parse5's cost grows with the square of nesting depth, so scripted bundles read 64 KiB, where Vite puts the title, and tier 0 takes its title from the document validateHtml already parsed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GPT 6.1 Sol review, round 2Sol confirmed the round 1 fixes: template, script, style and comment handling were checked in a browser; rollback restore and fallback were checked against SQL; all 19 HTML fixtures keep their titles and warnings. Sol agreed with leaving historical addresses as they are. One finding: should-fix: a title cut at the read limit came out truncated. If the 512 KiB prefix ended inside Found while fixing it: parse5's cost grows with the square of nesting depth. 40,000 nested
Not in this PR: tier 0 publish already fully parses up to 512 KiB, so it has had that quadratic worst case since before this change. It needs a nesting cap or a cheaper check of its own. Local |
Review found `patchy dev` read every tier's title through the scripted 64 KiB limit, so a tier 0 page with an embedded font before its <title> showed its name locally but its title once published. Tier 0 dev now takes the title from validateHtml, on the first build and each rebuild. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GPT 6.1 Sol review, round 3Sol confirmed 300ff41. should-fix: |
GPT 6.1 Sol review, round 4Clean: no findings left worth fixing. 93c4887 handles tier 0 titles on the first build and on rebuilds. The dev manifest's tier is fixed until restart, and watched builds enforce the 512 KiB cap before reading the title. The title, favicon, escaping and CSP probes all passed. |
…s and Company pages are easier to use (#667) Release 11's What's new entry, written through `a253cb2`. It ships as `patchy` `0.11.0`. **Changes** - New: Tools can show your PostHog data (#662, #664) - Improved: The Connections page stays clear with one connection or thirty (#657) - Improved: Find anyone on the Company page (#661) - New: Invite many people at once (#661) - Fixed: Browser tabs show Patchy's icon and your tool's name (#660) **Behind the scenes** - Each version of Patchy now skips kinds of connection it doesn't know, so going back to an earlier version stays safe (#657) **Deploying in two steps.** `c1e7de9` (#657 and everything before it) is released first, with no entry of its own. Then main is released with this entry. A rollback from the PostHog release therefore lands on a release that hides PostHog connections and dev-read calls instead of failing on them. Global CLIs and patch repos on `0.10.0` are told to upgrade, as on any release. Made by Claude Opus 5.5 via Claude Code in T3 Code Co-authored-by: Claude Opus 5.5 <[email protected]>
…#684) The shared first-party shell (`htmlPage`) painted a fixed `feTurbulence` noise texture behind every page. On every page whose policy allowed it, body's opaque background covered it. On the HTML 404, the strict fallback CSP blocked it and logged a violation. Since #660 added `img-src data:` to that fallback for the favicon, the 404 no longer logs the violation. Instead, the grain now shows faintly in the strip below the 404's short body, the only place it ever renders. This PR deletes the `body::before` rule from `htmlPage`'s stylesheet. No content-security-policy changes. `examples/plan.html` keeps its copy because it isn't served, and the 404's layout is #618. One note against the brief: its "no CSP violation on `dev shot /nothing`" criterion was already true on main because of #660. On the 404, this PR changes the lower strip, which goes back to plain paper. That is how the 404 looked when the brief was written. **Tested by hand** (`pnpm dev up team`, then `pnpm dev down`): - `pnpm dev shot ada /nothing`: the before shot had faint grain below the body; the after shot is plain paper. Both runs reported only one browser error, the document's own 404. - Playwright, with fresh contexts for the signed-out sign-in door `/` and, as Ada, `/`, `/company`, `/company/connections`, `/whats-new`, `/~shell/notice/access_denied` and `/nothing`, at 390×844, 900×600 and 1600×1400. I compared each page as served against the same page with the deleted rule injected back. The screenshots are byte-identical everywhere except `/nothing`. - curl: none of those responses contain `feTurbulence`. The `/nothing` `content-security-policy` is byte-identical to the one captured before the change. - vitest for core, serving `Pages`, portal and auth: 271 tests passed on the rebased branch. CI runs the full suites. **Hit every surface:** only *Served pages* applied. The `ui-consistency` spec says nothing about the overlay, and the fixtures under `packages/core/fixtures` are patch HTML, so neither changes. The company look's `LOOK.md` already records the noise overlay as dropped. Wire contract, CLI, dev loop, vocabulary, migrations, company resources, reverse states and repo layout don't apply. Closes #591 Made by Claude Opus 5.5 in Claude Code, running in T3 Code.
Patchy had no favicon anywhere: the dashboard, sign-in pages and every patch tab showed a blank square. Tier 1 and 2 patch tabs also showed the address name (
launch-queue) instead of the page's title, because publish only read<title>for tier 0. The patch's own<title>sits inside the iframe, where it never reaches the tab.Favicon. Every Patchy page and patch tab now shows the mark from patchyhq.com. It's inlined as a
data:URL inhtmlPageand the patch shell, so there's no new route. The scripted shell's CSP gainsimg-src data:for it; the other pages already alloweddata:images. The look preview is left alone, because it must pass tier 0 validation, which refuses<link>.Titles. Tier 1 and 2 publish and
patchy devtake the title from the page's<title>, as tier 0 already did, and fall back to the name. One rule,documentTitle, now serves every tier: the first HTML<title>, as browsers pick it (an icon's SVG<title>doesn't count, and an empty one falls back to the name). Scripted bundles are read only to 64 KiB, because Vite builds put<title>before the inlined code and a full parse of a 10 MB bundle blocks for ~650 ms; a title cut by that limit falls back to the name. Tier 0 keeps reading its whole (512 KiB) page. Rollback now restores the title the version published with, which tier 0 lacked too.patchy initwrites the patch's name (Launch queue) instead ofNotes/My patch, and thepatchy-loopskill tells agents that<title>names the tab. Existing patches pick up their title on their next publish. The portal card is unchanged for these patches: a title that only differs from the name by case and dashes isn't shown as a second line.Checked on a local instance: a fresh tier 1
launch-queuepatch publishes with"title":"Launch queue". In Chromium and Firefox (which appliesimg-srcto favicons), the sign-in page, portal, tier 1 patch and not-found page all carry the icon, it decodes, and no CSP violations are logged:pnpm checkpasses. New tests cover how the title is picked (SVG, empty, 20,000-deep markup and a title cut by the read limit) and a tier 1 publish that falls back to the name and gets its title back on rollback. GPT 6.1 Sol reviewed it; the findings and fixes are in the comments.Made by Claude Opus 5.5 via Claude Code in T3 Code