From c4fc6edaa7b835193ab341ea5d1d53c1860e4aa6 Mon Sep 17 00:00:00 2001 From: mtblck <105079242+mtblck@users.noreply.github.com> Date: Wed, 25 Nov 2026 02:14:34 +0000 Subject: [PATCH 1/3] Rearrange the app's mode bar, canvas foot and sidebar footer; tipjar 2.2 menu - Split/Difference/Vector move up beside the mode tabs, after a divider, with the active one in the primary mustard. - Undo and Redo leave the tool rail for the mode bar, after a second divider. - The canvas foot puts Paths, Nodes and zoom on the left, the hint on the right. - The sidebar footer drops Support Inlay, sits right-aligned, and opens its links in new tabs (the phone's menu too). - tipjar 1.2.0 -> 2.2.0; the header's Support button opens a menu: Tip on Ko-fi and Star on GitHub. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018HstUmb9GRyN44HGSHP7r9 --- apps/app/package.json | 2 +- apps/app/src/App.tsx | 125 ++++++++++++++------------ apps/app/src/components/Dock.tsx | 6 +- apps/app/src/components/Support.tsx | 20 +++-- apps/app/src/components/Workspace.tsx | 15 +--- apps/app/src/index.css | 11 +++ apps/site/package.json | 2 +- package-lock.json | 10 +-- scripts/verify.mjs | 20 +++-- 9 files changed, 122 insertions(+), 89 deletions(-) diff --git a/apps/app/package.json b/apps/app/package.json index 08a4913..0cce0d8 100644 --- a/apps/app/package.json +++ b/apps/app/package.json @@ -15,6 +15,6 @@ "react-dom": "19.3.1", "svgo": "4.1.0", "tesseract.js-core": "7.0.0", - "tipjar": "1.2.0" + "tipjar": "2.2.0" } } diff --git a/apps/app/src/App.tsx b/apps/app/src/App.tsx index 51b5f6e..8de72ea 100644 --- a/apps/app/src/App.tsx +++ b/apps/app/src/App.tsx @@ -68,7 +68,7 @@ import { bounds, effective, fromSlider, snap, step, toSlider, type Zoom } from ' import { sampleImage } from './lib/sample' import { track } from './lib/track' import { Canvas, type Overlays, type SelectMode, type Tool, type ViewMode } from './components/Canvas' -import { ShortcutsDialog } from './components/Shortcuts' +import { REDO_KEYS, ShortcutsDialog, UNDO_KEYS } from './components/Shortcuts' import { ExportOptions } from './components/ExportOptions' import { CLEAN_TOOLS, EDIT_TOOLS, ModeSwitch, ToolRail, useWide, type WorkMode } from './components/Workspace' import { Dock, DOCK_ICON, MoreMenu, type DockSlot } from './components/Dock' @@ -1229,10 +1229,6 @@ export default function App() { tools={EDIT_TOOLS(strokes, lineTrace)} tool={tool} onTool={chooseTool} - canUndo={history.past.length > 0} - canRedo={history.future.length > 0} - onUndo={() => historyStep('undo')} - onRedo={() => historyStep('redo')} /> ) const cleanRail = ( @@ -1240,10 +1236,6 @@ export default function App() { tools={CLEAN_TOOLS(settings.removeBackground)} tool={cleanTool} onTool={chooseCleanTool} - canUndo={history.past.length > 0} - canRedo={history.future.length > 0} - onUndo={() => historyStep('undo')} - onRedo={() => historyStep('redo')} /> ) const modeRail = workMode === 'edit' ? rail : workMode === 'clean' ? cleanRail : null @@ -1659,6 +1651,42 @@ export default function App() { ] : [view('image', 'Image'), view('type', 'Type'), view('tune', 'Tune'), view('export', 'Export')] + /** Split, Difference and Vector: beside the mode tabs on a wide screen, in the canvas's foot on a phone. Active in the primary buttons' mustard. */ + const compare = ( +
+ {( + [ + ['split', 'Split'], + ['difference', 'Difference'], + ['vector', 'Vector'], + ] as const + ).map(([v, label]) => ( + + ))} +
+ ) + return (
+ {workMode !== 'clean' && ( + <> +
{modeRail && wide && modeRail} @@ -1834,44 +1881,11 @@ export default function App() { )}
- {/* One row, the same height as the sidebar's footer beside it (lg). The hint shows where there's room for it - (each view's button carries it as a tooltip too) and shortens rather than wrapping. */} -
-
- {( - [ - ['split', 'Split'], - ['difference', 'Difference'], - ['vector', 'Vector'], - ] as const - ).map(([v, label]) => ( - - ))} -
-

- {COMPARE_HINT[mode]} -

+ {/* One row, the same height as the sidebar's footer beside it (lg): the overlays and zoom on the left (a wide screen has + Split, Difference and Vector above, beside the modes). The hint shows where there's room for it, at the right + (each view's button carries it as a tooltip too), and shortens rather than wrapping. */} +
+ {!wide && compare}
+

+ {COMPARE_HINT[mode]} +

) : ( @@ -2185,20 +2202,18 @@ export default function App() {
)} - {/* No room for a page footer, so one quiet line ends the sidebar. A phone has these in the header's menu. */} -
) } diff --git a/apps/app/src/index.css b/apps/app/src/index.css index 09040fd..21a02a5 100644 --- a/apps/app/src/index.css +++ b/apps/app/src/index.css @@ -245,6 +245,8 @@ --tipjar-font-size: 13px; --tipjar-icon-size: 14px; --tipjar-shadow: none; + --tipjar-menu-radius: 10px; + --tipjar-menu-gap: 6px; } /* Over the canvas while it's tracing or optimising. Fades in after a beat, so a quick @@ -390,3 +392,12 @@ display: block; } } + +/* The header tip button's menu (Ko-fi and the GitHub repo) hangs from the button's right edge, at the + header's right. Unlayered, so it wins over tipjar's own (unlayered) stylesheet. */ +@supports (position-area: bottom) { + header .tipjar-list[data-position='inline'] { + position-area: bottom span-left; + box-shadow: 0 8px 18px -8px rgb(0 0 0 / 0.5); + } +} diff --git a/apps/site/package.json b/apps/site/package.json index 4202e6b..8e3b20f 100644 --- a/apps/site/package.json +++ b/apps/site/package.json @@ -12,6 +12,6 @@ "dependencies": { "@astrojs/starlight": "0.42.11", "astro": "7.4.11", - "tipjar": "1.2.0" + "tipjar": "2.2.0" } } diff --git a/package-lock.json b/package-lock.json index 4165f3c..b0b7a92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,7 +54,7 @@ "react-dom": "19.3.1", "svgo": "4.1.0", "tesseract.js-core": "7.0.0", - "tipjar": "1.2.0" + "tipjar": "2.2.0" } }, "apps/site": { @@ -64,7 +64,7 @@ "dependencies": { "@astrojs/starlight": "0.42.11", "astro": "7.4.11", - "tipjar": "1.2.0" + "tipjar": "2.2.0" } }, "node_modules/@andrewbranch/untar.js": { @@ -8299,9 +8299,9 @@ } }, "node_modules/tipjar": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/tipjar/-/tipjar-1.2.0.tgz", - "integrity": "sha512-5M/yHG9WEUcxahX9uNiKh84AoyaMzdjLMaSDOTorLBdnR8rr400W66m7oT5OlXwqM4Y9CLq7GiG9IE2jYbhQEA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tipjar/-/tipjar-2.2.0.tgz", + "integrity": "sha512-H26cleX8ae+KD2N/bt8Ev5tI4uyAlQ8JKfYjyNNwi+MRdq/xphcW9+/ZymxroxmdVmTLmV2HVj+F5C2Cp/6XNQ==", "license": "MIT", "engines": { "node": ">=22" diff --git a/scripts/verify.mjs b/scripts/verify.mjs index 5659c42..016295f 100644 --- a/scripts/verify.mjs +++ b/scripts/verify.mjs @@ -624,7 +624,9 @@ const csp = response?.headers()['content-security-policy'] ?? '' check(!csp.includes("'wasm-unsafe-eval'"), "the app page's CSP allows no WebAssembly (only the AI worker may)") check(/worker-src[^;]*'self'/.test(csp) && !csp.includes("'sha256-"), "the app gets its own CSP (workers allowed), not the site's") check((await page.getByRole('link', { name: 'Inlay', exact: true }).getAttribute('href')) === '/', 'the Inlay wordmark leads to the landing page') -check((await page.getByRole('navigation', { name: 'About Inlay' }).getByRole('link', { name: 'Privacy' }).getAttribute('href')) === '/privacy/', 'the app links to the privacy page') +const privacyLink = page.getByRole('navigation', { name: 'About Inlay' }).getByRole('link', { name: 'Privacy' }) +check((await privacyLink.getAttribute('href')) === '/privacy/' && (await privacyLink.getAttribute('target')) === '_blank', 'the app links to the privacy page, in a new tab') +check((await page.getByRole('navigation', { name: 'About Inlay' }).getByRole('link', { name: /Support/ }).count()) === 0, 'the sidebar footer leaves Support to the header') await shot(page, '01-empty') await page.getByRole('button', { name: 'Try a sample' }).click() @@ -647,7 +649,10 @@ check((await page.locator('[data-rail]').count()) === 0, 'Trace mode has no tool await page.getByRole('tab', { name: /Edit/ }).click() check(await viewIs('Vector'), 'starting to edit switches to Vector, hiding the original') const rail = page.locator('[data-rail]') -check((await rail.getByRole('radio').count()) === 8 && (await rail.getByRole('button', { name: 'Undo' }).count()) === 1, 'Edit mode shows the tool rail: Select, Nodes, Mirror, Fill, Pen, Shape, Eraser, Knife, Undo and Redo') +check((await rail.getByRole('radio').count()) === 8 && (await rail.getByRole('button', { name: 'Undo' }).count()) === 0, 'Edit mode shows the tool rail: Select, Nodes, Mirror, Fill, Pen, Shape, Eraser and Knife') +// The mode bar: the modes, then Split/Difference/Vector, then Undo and Redo. +const modeBar = page.locator('[data-workspace]') +check((await modeBar.getByRole('radiogroup', { name: 'Compare' }).count()) === 1 && (await modeBar.getByRole('group', { name: 'History' }).getByRole('button', { name: 'Undo' }).count()) === 1, 'the mode bar holds the compare views and Undo and Redo') await rail.getByRole('radio', { name: 'Nodes' }).click() check((await page.locator('#panel-edit h2').first().innerText()) === 'Nodes', 'the panel follows the rail’s tool') // Leaving Edit puts its tools away: back on Select, nothing selected, so Delete can't act unseen. @@ -859,12 +864,15 @@ check(closed, 'Esc closes the shortcuts panel') const cut = await page.getByRole('radiogroup', { name: 'Image type' }).locator('.field-hint').evaluateAll((els) => els.filter((e) => e.scrollWidth > e.clientWidth + 1).map((e) => e.textContent)) check(cut.length === 0, `every preset's description fits (${cut.join(', ') || 'none cut off'})`) -// Inlay is free: the header has a tip button (tipjar) to Ko-fi, in a new tab, and nothing to sign in to or buy. -const tip = page.locator('header a.tipjar') +// Inlay is free: the header has a tip button (tipjar) opening a menu of Ko-fi and the GitHub repo, each in a new tab, and nothing to sign in to or buy. +const tip = page.locator('header button.tipjar') +await tip.click() +const tipLinks = await page.locator('.tipjar-list a').evaluateAll((els) => els.map((a) => `${a.getAttribute('href')} ${a.getAttribute('target')}`)) check( - (await tip.count()) === 1 && (await tip.getAttribute('href')) === 'https://ko-fi.com/mtblck' && (await tip.getAttribute('target')) === '_blank' && (await tip.innerText()).includes('Support'), - 'the header has a Support button linking to Ko-fi in a new tab', + (await tip.innerText()).includes('Support') && tipLinks.join() === 'https://ko-fi.com/mtblck _blank,https://github.com/mtblck/inlaytrace _blank' && (await page.locator('.tipjar-list').isVisible()), + `the header's Support button opens Ko-fi and the GitHub repo, in new tabs (${tipLinks.join(', ')})`, ) +await page.keyboard.press('Escape') check(apiRequests.length === 0, `the app never calls /api: no sign-in, credits or HD (${apiRequests.join(', ') || 'no calls'})`) // Header icons: the keyboard opens the same panel; the tooltip shows on keyboard focus; sun/moon switches theme. From 751f8483d4307fff581489d051bba1d652ff25a4 Mon Sep 17 00:00:00 2001 From: mtblck <105079242+mtblck@users.noreply.github.com> Date: Wed, 25 Nov 2026 02:18:39 +0000 Subject: [PATCH 2/3] Mode tabs: the active one in the primary mustard too Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018HstUmb9GRyN44HGSHP7r9 --- apps/app/src/components/Workspace.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/app/src/components/Workspace.tsx b/apps/app/src/components/Workspace.tsx index b1a6055..4cfc609 100644 --- a/apps/app/src/components/Workspace.tsx +++ b/apps/app/src/components/Workspace.tsx @@ -14,7 +14,7 @@ export type WorkMode = 'clean' | 'trace' | 'edit' export const MODE_LABEL: Record = { clean: 'Clean up', trace: 'Trace', edit: 'Edit' } -/** The mode tabs, above the canvas. `edited` marks Edit when the drawing has shape edits. */ +/** The mode tabs, above the canvas, the active one in the primary buttons' mustard. `edited` marks Edit when the drawing has shape edits. */ export function ModeSwitch({ modes, mode, onMode, edited }: { modes: WorkMode[]; mode: WorkMode; onMode: (m: WorkMode) => void; edited: boolean }) { return (
@@ -26,11 +26,11 @@ export function ModeSwitch({ modes, mode, onMode, edited }: { modes: WorkMode[]; aria-selected={mode === m} aria-controls={`panel-${m}`} onClick={() => onMode(m)} - className={`flex items-center px-2.5 py-1 text-[13px] sm:px-3.5 ${mode === m ? 'bg-paper font-medium text-accent' : 'bg-paper-sunk text-ink hover:bg-paper'}`} + className={`flex items-center px-2.5 py-1 text-[13px] sm:px-3.5 ${mode === m ? 'bg-mark font-medium text-mark-ink' : 'bg-paper-sunk text-ink hover:bg-paper'}`} > {MODE_LABEL[m]} {m === 'edit' && edited && ( - + (edited) )} From 8ea1924f6bda340e9524aee30d159f3f51f6b6ed Mon Sep 17 00:00:00 2001 From: mtblck <105079242+mtblck@users.noreply.github.com> Date: Wed, 25 Nov 2026 02:23:35 +0000 Subject: [PATCH 3/3] Light theme: a light grey header Its hovers take a deeper grey so they still show. Also fixes the phone undo/redo comment (they moved to the mode bar on a wide screen). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018HstUmb9GRyN44HGSHP7r9 --- apps/app/src/App.tsx | 4 ++-- apps/app/src/index.css | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/app/src/App.tsx b/apps/app/src/App.tsx index 8de72ea..f3e6e39 100644 --- a/apps/app/src/App.tsx +++ b/apps/app/src/App.tsx @@ -1708,7 +1708,7 @@ export default function App() { }} > {/* On a phone the page scrolls under it until a trace opens; then the layout fits the screen. */} -
+

{/* The landing page and docs live beside the app, at the site root. */} @@ -1724,7 +1724,7 @@ export default function App() {

Image to SVG, in your browser.

- {/* A phone's undo and redo: on a wide screen they are at the foot of the tool rail. */} + {/* A phone's undo and redo: on a wide screen they are in the mode bar above the canvas. */} {docked && workMode !== 'trace' && (
historyStep('undo')}> diff --git a/apps/app/src/index.css b/apps/app/src/index.css index 21a02a5..3abd849 100644 --- a/apps/app/src/index.css +++ b/apps/app/src/index.css @@ -34,6 +34,8 @@ --c-on-mat-strong: #eef2ee; /* The phone's dock: white on the paper, so it reads as a bar of its own. */ --c-dock: #ffffff; + /* The header: a light grey band, to break up the paper below it. */ + --c-header: #e8ece9; /* Its height above the phone's own inset (the iPhone home bar). */ --dock-h: calc(70px + env(safe-area-inset-bottom)); } @@ -41,6 +43,7 @@ :root[data-theme='dark'] { color-scheme: dark; --c-dock: #1b2a24; + --c-header: #131e1a; --c-paper: #131e1a; --c-paper-sunk: #1b2a24; --c-ink: #eef2ee; @@ -63,6 +66,7 @@ @theme inline { --color-paper: var(--c-paper); --color-paper-sunk: var(--c-paper-sunk); + --color-header: var(--c-header); --color-ink: var(--c-ink); --color-ink-muted: var(--c-ink-muted); --color-ink-faint: var(--c-ink-faint); @@ -401,3 +405,8 @@ box-shadow: 0 8px 18px -8px rgb(0 0 0 / 0.5); } } + +/* On the light header's grey, hovers take a deeper grey so they still show. */ +:root:not([data-theme='dark']) header.app-header { + --c-paper-sunk: #dae0dc; +}