From ce51499d1d6a56d6fbec0cb23bf5cc4c8c113a8c Mon Sep 17 00:00:00 2001 From: brainstorm-os Date: Thu, 19 Nov 2026 14:16:06 +0100 Subject: [PATCH 1/4] =?UTF-8?q?style(sdk):=20format=20b59-cells.test=20?= =?UTF-8?q?=E2=80=94=20main's=20lint=20step=20has=20been=20red=20since=20#?= =?UTF-8?q?513?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.2 --- packages/sdk/src/property-ui/cells/b59-cells.test.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/sdk/src/property-ui/cells/b59-cells.test.tsx b/packages/sdk/src/property-ui/cells/b59-cells.test.tsx index 8160d06a..c02549a3 100644 --- a/packages/sdk/src/property-ui/cells/b59-cells.test.tsx +++ b/packages/sdk/src/property-ui/cells/b59-cells.test.tsx @@ -179,7 +179,9 @@ describe("File cells (accept-only)", () => { onChange: vi.fn(), noteId: "n1", }); - expect(h.container.querySelector(".bs-cell-file-pending")?.textContent).toContain("aren't available here"); + expect(h.container.querySelector(".bs-cell-file-pending")?.textContent).toContain( + "aren't available here", + ); expect(h.container.querySelector(".bs-cell-file-empty")).not.toBeNull(); }); From 5814383c3b7c964862c3b2a8c89bc34f1b4baf3f Mon Sep 17 00:00:00 2001 From: brainstorm-os Date: Thu, 19 Nov 2026 14:29:28 +0100 Subject: [PATCH 2/4] fix(first-run): a new vault opens on its dashboard, not the release history; the template step fits the window - A vault created by this build is stamped as having seen the bundled changelog, so What's New no longer opens over a first-time user's dashboard. - The Start step drops the brand hero: with seven template tiles under it the card outgrew a default window and Create vault sat below the fold. - The starter journal entry carries the snippet + word count Journal reads, so it no longer says "0 words" and "No entry yet." beside its own text. - The starter bookmark points at docs.getbrainstorm.online, not a domain the project does not serve. - Chat: a vault with no channels says so instead of "Pick a channel"; the channel sidebar and Preview's file sidebar use the same background as every other app's. - Database list descriptions no longer trail a raw type id; seven first-run strings say "objects"/"nothing" instead of "entities". Co-Authored-By: Claude Fable 5.2 --- apps/chat/src/app.tsx | 4 +-- apps/chat/src/i18n/de.json | 2 ++ apps/chat/src/i18n/en.json | 2 ++ apps/chat/src/i18n/es.json | 2 ++ apps/chat/src/i18n/fr.json | 2 ++ apps/chat/src/i18n/it.json | 2 ++ apps/chat/src/i18n/pt.json | 2 ++ apps/chat/src/styles.css | 2 +- apps/database/src/i18n/de.json | 5 ++- apps/database/src/i18n/en.json | 5 ++- apps/database/src/i18n/es.json | 5 ++- apps/database/src/i18n/fr.json | 5 ++- apps/database/src/i18n/it.json | 5 ++- apps/database/src/i18n/pt.json | 5 ++- apps/database/src/logic/vault-lists.test.ts | 8 ++--- apps/database/src/logic/vault-lists.ts | 12 +++---- apps/files/src/i18n/en.json | 2 +- apps/files/src/i18n/es.json | 2 +- apps/form-designer/src/i18n/en.json | 4 +-- apps/form-designer/src/i18n/es.json | 4 +-- apps/graph/src/i18n/de.json | 4 +-- apps/graph/src/i18n/en.json | 4 +-- apps/graph/src/i18n/es.json | 4 +-- apps/graph/src/i18n/fr.json | 4 +-- apps/graph/src/i18n/it.json | 4 +-- apps/graph/src/i18n/pt.json | 4 +-- apps/preview/src/styles.css | 2 +- packages/shell/src/main/index.ts | 18 +++++++++++ .../src/main/welcome/welcome-content.test.ts | 15 +++++++++ .../shell/src/main/welcome/welcome-content.ts | 31 ++++++++++++++----- .../src/renderer/welcome/template-gallery.tsx | 2 +- .../welcome/welcome-templates.test.tsx | 13 ++++++++ .../shell/src/renderer/welcome/welcome.tsx | 17 +++++++--- 33 files changed, 139 insertions(+), 63 deletions(-) diff --git a/apps/chat/src/app.tsx b/apps/chat/src/app.tsx index 06e71134..4fd0cbf2 100644 --- a/apps/chat/src/app.tsx +++ b/apps/chat/src/app.tsx @@ -932,8 +932,8 @@ export function ChatApp(): ReactElement {
{ links: [], }; const { lists } = buildVaultLists(one, NOW); - expect(lists[0]?.description).toBe("1 item · brainstorm/Doc/v1"); + expect(lists[0]?.description).toBe("1 item"); }); }); @@ -374,7 +374,7 @@ describe("curated People list (9.12.13(b))", () => { (l) => l.source?.kind === ListSourceKind.ByType && l.source.types[0] === "brainstorm/Person/v1", ); expect(people?.name).toBe("People"); - expect(people?.description).toBe("2 contacts · brainstorm/Person/v1"); + expect(people?.description).toBe("2 contacts"); expect(people?.views).toHaveLength(3); expect(people?.defaultViewId).toBe(people?.views[0]); @@ -439,7 +439,7 @@ describe("curated Tasks list (9.14.4)", () => { (l) => l.source?.kind === ListSourceKind.ByType && l.source.types[0] === "brainstorm/Task/v1", ); expect(tasks?.name).toBe("Tasks"); - expect(tasks?.description).toBe("2 tasks · brainstorm/Task/v1"); + expect(tasks?.description).toBe("2 tasks"); expect(tasks?.views).toHaveLength(3); expect(tasks?.defaultViewId).toBe(tasks?.views[0]); @@ -499,6 +499,6 @@ describe("curated Tasks list (9.14.4)", () => { links: [], }; const tasks = buildVaultLists(one, NOW).lists[0]; - expect(tasks?.description).toBe("1 task · brainstorm/Task/v1"); + expect(tasks?.description).toBe("1 task"); }); }); diff --git a/apps/database/src/logic/vault-lists.ts b/apps/database/src/logic/vault-lists.ts index c85caf14..2a2931be 100644 --- a/apps/database/src/logic/vault-lists.ts +++ b/apps/database/src/logic/vault-lists.ts @@ -142,10 +142,10 @@ export function buildVaultLists( id: listId, name: friendlyTypeName(type), icon: null, - description: t("brainstorm.database.vault.typeList.description", { - items: itemCountLabel(rows.length), - type, - }), + // The count alone: the raw type id (`brainstorm/Agent/v1`) used to + // trail it, and it was the first line of text under the first list + // a new user opened. + description: itemCountLabel(rows.length), source: { kind: ListSourceKind.ByType, types: [type] }, members: { include: [], exclude: [] }, views: [viewId], @@ -381,7 +381,7 @@ const CURATED_TYPE_LISTS: Record = { // Columns mirror the `brainstorm/Task/v1` shape (apps/tasks task.ts). "brainstorm/Task/v1": { name: "Tasks", - description: (n) => `${n} ${n === 1 ? "task" : "tasks"} · brainstorm/Task/v1`, + description: (n) => `${n} ${n === 1 ? "task" : "tasks"}`, columns: ["name", "statusKey", "priority", "scheduledAt", "dueAt"], views: [ { @@ -423,7 +423,7 @@ const CURATED_TYPE_LISTS: Record = { }, "brainstorm/Person/v1": { name: "People", - description: (n) => `${n} ${n === 1 ? "contact" : "contacts"} · brainstorm/Person/v1`, + description: (n) => `${n} ${n === 1 ? "contact" : "contacts"}`, columns: ["name", "email", "phone", "company", "role"], views: [ { diff --git a/apps/files/src/i18n/en.json b/apps/files/src/i18n/en.json index 6748b342..94659d62 100644 --- a/apps/files/src/i18n/en.json +++ b/apps/files/src/i18n/en.json @@ -132,7 +132,7 @@ "brainstorm.files.empty.body": "Drag files in, or create a folder to get started.", "brainstorm.files.empty.newFolder": "New folder", "brainstorm.files.empty.searchTitle": "No matches", - "brainstorm.files.empty.searchBody": "No entities in this scope match {query}.", + "brainstorm.files.empty.searchBody": "Nothing in this scope matches {query}.", "brainstorm.files.inspector.tabsRegion": "Inspector tabs", "brainstorm.files.inspector.tabPreview": "Preview", "brainstorm.files.inspector.tabProperties": "Properties", diff --git a/apps/files/src/i18n/es.json b/apps/files/src/i18n/es.json index 94d8e6ce..8889fafc 100644 --- a/apps/files/src/i18n/es.json +++ b/apps/files/src/i18n/es.json @@ -132,7 +132,7 @@ "brainstorm.files.empty.body": "Arrastre archivos aquí o cree una carpeta para empezar.", "brainstorm.files.empty.newFolder": "Nueva carpeta", "brainstorm.files.empty.searchTitle": "Sin coincidencias", - "brainstorm.files.empty.searchBody": "Ninguna entidad en este ámbito coincide con {query}.", + "brainstorm.files.empty.searchBody": "Ningún objeto en este ámbito coincide con {query}.", "brainstorm.files.inspector.tabsRegion": "Pestañas del inspector", "brainstorm.files.inspector.tabPreview": "Vista previa", "brainstorm.files.inspector.tabProperties": "Propiedades", diff --git a/apps/form-designer/src/i18n/en.json b/apps/form-designer/src/i18n/en.json index a4061812..031294e9 100644 --- a/apps/form-designer/src/i18n/en.json +++ b/apps/form-designer/src/i18n/en.json @@ -4,7 +4,7 @@ "sidebar.region": "Saved forms", "sidebar.resize": "Resize form list", "sidebar.newForm": "New form", - "sidebar.empty": "No forms yet — create one to collect entities.", + "sidebar.empty": "No forms yet. Create one to collect new objects.", "sidebar.untitled": "Untitled form", "sidebar.itemActions": "Form actions", "sidebar.delete": "Delete form", @@ -17,7 +17,7 @@ "mode.region": "Form mode", "builder.nameLabel": "Form name", "builder.namePlaceholder": "Name this form…", - "builder.targetLabel": "Creates entities of type", + "builder.targetLabel": "Creates objects of type", "builder.targetPlaceholder": "Entity type URL (e.g. brainstorm/Object/v1)", "builder.layoutLabel": "Layout", "builder.layoutStacked": "Stacked", diff --git a/apps/form-designer/src/i18n/es.json b/apps/form-designer/src/i18n/es.json index 03a94697..93a828b0 100644 --- a/apps/form-designer/src/i18n/es.json +++ b/apps/form-designer/src/i18n/es.json @@ -4,7 +4,7 @@ "sidebar.region": "Formularios guardados", "sidebar.resize": "Redimensionar lista de formularios", "sidebar.newForm": "Nuevo formulario", - "sidebar.empty": "Aún no hay formularios — crea uno para recopilar entidades.", + "sidebar.empty": "Aún no hay formularios — crea uno para recopilar objetos.", "sidebar.untitled": "Formulario sin título", "sidebar.itemActions": "Acciones del formulario", "sidebar.delete": "Eliminar formulario", @@ -17,7 +17,7 @@ "mode.region": "Modo de formulario", "builder.nameLabel": "Nombre del formulario", "builder.namePlaceholder": "Ponle nombre a este formulario…", - "builder.targetLabel": "Crea entidades de tipo", + "builder.targetLabel": "Crea objetos de tipo", "builder.targetPlaceholder": "URL del tipo de entidad (p. ej. brainstorm/Object/v1)", "builder.layoutLabel": "Diseño", "builder.layoutStacked": "Apilado", diff --git a/apps/graph/src/i18n/de.json b/apps/graph/src/i18n/de.json index 5774dcc8..05030be8 100644 --- a/apps/graph/src/i18n/de.json +++ b/apps/graph/src/i18n/de.json @@ -37,7 +37,7 @@ "path.hint.hops": "Verbunden über {count} Sprünge", "path.hint.none": "Kein Pfad verbindet diese beiden Knoten", "show.toggle": "{type} anzeigen", - "show.empty": "Noch keine Entitäten in diesem Vault.", + "show.empty": "Dieser Vault ist noch leer.", "show.systemGroup": "System", "type.any": "Beliebiger Typ", "type.someSelected": "{count} Typen", @@ -73,7 +73,7 @@ "status.noVault": "Kein Vault", "status.loading": "Vault wird geladen…", "status.listMissing": "vaultEntities.list fehlt", - "status.empty": "Keine Entitäten — erstellen Sie eine Notiz", + "status.empty": "Noch nichts zu zeigen — erstellen Sie eine Notiz", "status.count": "{count} {noun}", "status.entitySingular": "Entität", "status.entityPlural": "Entitäten", diff --git a/apps/graph/src/i18n/en.json b/apps/graph/src/i18n/en.json index 0cde1015..8727b9b7 100644 --- a/apps/graph/src/i18n/en.json +++ b/apps/graph/src/i18n/en.json @@ -37,7 +37,7 @@ "path.hint.hops": "Connected in {count} hops", "path.hint.none": "No path connects those two nodes", "show.toggle": "Show {type}", - "show.empty": "No entities in this vault yet.", + "show.empty": "Nothing in this vault yet.", "show.systemGroup": "System", "type.any": "Any type", "type.someSelected": "{count} types", @@ -73,7 +73,7 @@ "status.noVault": "No vault", "status.loading": "Loading vault…", "status.listMissing": "vaultEntities.list missing", - "status.empty": "No entities — create a note", + "status.empty": "Nothing to show yet. Create a note", "status.count": "{count} {noun}", "status.entitySingular": "entity", "status.entityPlural": "entities", diff --git a/apps/graph/src/i18n/es.json b/apps/graph/src/i18n/es.json index 2f92f08d..46e78c57 100644 --- a/apps/graph/src/i18n/es.json +++ b/apps/graph/src/i18n/es.json @@ -37,7 +37,7 @@ "path.hint.hops": "Conectados en {count} saltos", "path.hint.none": "Ninguna ruta conecta esos dos nodos", "show.toggle": "Mostrar {type}", - "show.empty": "Aún no hay entidades en esta bóveda.", + "show.empty": "Esta bóveda aún está vacía.", "show.systemGroup": "Sistema", "type.any": "Cualquier tipo", "type.someSelected": "{count} tipos", @@ -73,7 +73,7 @@ "status.noVault": "Sin bóveda", "status.loading": "Cargando bóveda…", "status.listMissing": "Falta vaultEntities.list", - "status.empty": "Sin entidades — cree una nota", + "status.empty": "Aún no hay nada que mostrar — cree una nota", "status.count": "{count} {noun}", "status.entitySingular": "entidad", "status.entityPlural": "entidades", diff --git a/apps/graph/src/i18n/fr.json b/apps/graph/src/i18n/fr.json index eb0b1001..432e7aff 100644 --- a/apps/graph/src/i18n/fr.json +++ b/apps/graph/src/i18n/fr.json @@ -37,7 +37,7 @@ "path.hint.hops": "Connectés en {count} sauts", "path.hint.none": "Aucun chemin ne relie ces deux nœuds", "show.toggle": "Afficher {type}", - "show.empty": "Aucune entité dans ce coffre pour le moment.", + "show.empty": "Ce coffre est encore vide.", "show.systemGroup": "Système", "type.any": "Tout type", "type.someSelected": "{count} types", @@ -73,7 +73,7 @@ "status.noVault": "Aucun coffre", "status.loading": "Chargement du coffre…", "status.listMissing": "vaultEntities.list manquant", - "status.empty": "Aucune entité — créez une note", + "status.empty": "Rien à afficher pour l'instant — créez une note", "status.count": "{count} {noun}", "status.entitySingular": "entité", "status.entityPlural": "entités", diff --git a/apps/graph/src/i18n/it.json b/apps/graph/src/i18n/it.json index d51745ed..055480b8 100644 --- a/apps/graph/src/i18n/it.json +++ b/apps/graph/src/i18n/it.json @@ -37,7 +37,7 @@ "path.hint.hops": "Connessi in {count} salti", "path.hint.none": "Nessun percorso collega questi due nodi", "show.toggle": "Mostra {type}", - "show.empty": "Ancora nessuna entità in questo vault.", + "show.empty": "Questo vault è ancora vuoto.", "show.systemGroup": "Sistema", "type.any": "Qualsiasi tipo", "type.someSelected": "{count} tipi", @@ -73,7 +73,7 @@ "status.noVault": "Nessun vault", "status.loading": "Caricamento del vault…", "status.listMissing": "vaultEntities.list mancante", - "status.empty": "Nessuna entità — crei una nota", + "status.empty": "Ancora niente da mostrare — crei una nota", "status.count": "{count} {noun}", "status.entitySingular": "entità", "status.entityPlural": "entità", diff --git a/apps/graph/src/i18n/pt.json b/apps/graph/src/i18n/pt.json index 0f5c2a60..d3ae2e60 100644 --- a/apps/graph/src/i18n/pt.json +++ b/apps/graph/src/i18n/pt.json @@ -37,7 +37,7 @@ "path.hint.hops": "Conectados em {count} saltos", "path.hint.none": "Nenhum caminho conecta esses dois nós", "show.toggle": "Mostrar {type}", - "show.empty": "Ainda não há entidades neste vault.", + "show.empty": "Este vault ainda está vazio.", "show.systemGroup": "Sistema", "type.any": "Qualquer tipo", "type.someSelected": "{count} tipos", @@ -73,7 +73,7 @@ "status.noVault": "Nenhum vault", "status.loading": "Carregando vault…", "status.listMissing": "vaultEntities.list ausente", - "status.empty": "Nenhuma entidade — crie uma nota", + "status.empty": "Ainda não há nada para mostrar — crie uma nota", "status.count": "{count} {noun}", "status.entitySingular": "entidade", "status.entityPlural": "entidades", diff --git a/apps/preview/src/styles.css b/apps/preview/src/styles.css index 2922ba7c..0c58fdd5 100644 --- a/apps/preview/src/styles.css +++ b/apps/preview/src/styles.css @@ -86,7 +86,7 @@ button { min-height: 0; display: flex; flex-direction: column; - background: var(--bg-elev); + background: var(--bg); border-right: var(--border-width) solid var(--color-border-subtle); overflow: hidden; } diff --git a/packages/shell/src/main/index.ts b/packages/shell/src/main/index.ts index 7593502b..1e858f91 100644 --- a/packages/shell/src/main/index.ts +++ b/packages/shell/src/main/index.ts @@ -3311,6 +3311,23 @@ void app.whenReady().then(async () => { // well-formed pair. Scoped to the fresh-vault open (the same // `ensureRootFolder().created` signal as the welcome seed) so an existing // vault's chosen appearance is never overwritten. + // A vault this build just created has no earlier version to compare + // against, so "What's new" has nothing to say to it. Without the stamp the + // popover read the missing marker as "every release unseen" and a first-time + // user's first sight of their dashboard was the full release history. + const stampChangelogSeenOnFreshVault = async (): Promise => { + const session = getActiveVaultSession(); + if (!session) return; + try { + const { loadBundledChangelog } = await import("./ipc/help-handlers"); + const newest = loadBundledChangelog().releases[0]; + if (!newest) return; + (await session.dashboardStore()).setLastSeenChangelogVersion(newest.version); + } catch (error) { + console.warn(`[brainstorm] changelog stamp failed: ${(error as Error).message}`); + } + }; + const seedNewVaultDefaults = async (): Promise => { const session = getActiveVaultSession(); if (!session) return; @@ -3614,6 +3631,7 @@ void app.whenReady().then(async () => { } const freshVault = await ensureRootFolder(); if (freshVault) { + await stampChangelogSeenOnFreshVault(); await seedWelcomeOnFreshVault(); await seedNewVaultDefaults(); // The welcome seed creates entities through the privileged in-process diff --git a/packages/shell/src/main/welcome/welcome-content.test.ts b/packages/shell/src/main/welcome/welcome-content.test.ts index 57a2f319..1ef046dd 100644 --- a/packages/shell/src/main/welcome/welcome-content.test.ts +++ b/packages/shell/src/main/welcome/welcome-content.test.ts @@ -16,6 +16,21 @@ describe("buildWelcomeStarterSet", () => { expect(buildWelcomeStarterSet(NOW)).toEqual(buildWelcomeStarterSet(NOW)); }); + it("gives the journal entry the snippet and word count its preview reads", () => { + const journal = buildWelcomeStarterSet(NOW).find( + (e) => e.type === WelcomeEntityType.JournalEntry, + ); + expect(journal?.properties.body).toBe( + "Your first journal entry. Today you opened Brainstorm for the first time. A good first step: Take the product tour.", + ); + expect(journal?.properties.wordCount).toBe(20); + }); + + it("points the starter bookmark at the project's own docs site", () => { + const bookmark = buildWelcomeStarterSet(NOW).find((e) => e.type === WelcomeEntityType.Bookmark); + expect(bookmark?.properties.url).toBe("https://docs.getbrainstorm.online"); + }); + it("seed version is a positive integer", () => { expect(Number.isInteger(WELCOME_SEED_VERSION)).toBe(true); expect(WELCOME_SEED_VERSION).toBeGreaterThan(0); diff --git a/packages/shell/src/main/welcome/welcome-content.ts b/packages/shell/src/main/welcome/welcome-content.ts index 80ae0067..f95cc02a 100644 --- a/packages/shell/src/main/welcome/welcome-content.ts +++ b/packages/shell/src/main/welcome/welcome-content.ts @@ -124,6 +124,23 @@ function paragraph(children: Inline[]): Block { return { type: "paragraph", version: 1, format: "", indent: 0, direction: null, children }; } +/** The denormalised `body` snippet + `wordCount` an editor autosave would have + * written for these paragraphs. Journal reads its day preview and word count + * from those two properties, never from the Y.Doc, so a planted body without + * them showed "0 words" and "No entry yet." beside the entry itself. */ +function denormalized(paragraphs: Block[]): { body: string; wordCount: number } { + const plain = paragraphs + .map((block) => + block.children + .map((inline) => (inline.type === "mention" ? inline.label : inline.text)) + .join(""), + ) + .join(" ") + .replace(/\s+/g, " ") + .trim(); + return { body: plain, wordCount: plain ? plain.split(" ").length : 0 }; +} + function body(children: Block[]): WelcomeBody { return { root: { type: "root", version: 1, format: "", indent: 0, direction: null, children } }; } @@ -182,7 +199,7 @@ export function buildWelcomeStarterSet(now: number): WelcomeStarterEntity[] { // Database/Graph show it). properties: { title: "Brainstorm — help & docs", - url: "https://brainstorm.app", + url: "https://docs.getbrainstorm.online", savedAt: now, ...ts, }, @@ -193,15 +210,15 @@ export function buildWelcomeStarterSet(now: number): WelcomeStarterEntity[] { // projection keys entries by an `YYYY-MM-DD` title); the UTC derivation // keeps the output byte-identical for a given `now`. const journalDateKey = new Date(now).toISOString().slice(0, 10); + const journalParagraphs = [ + paragraph([text("Your first journal entry. Today you opened Brainstorm for the first time.")]), + paragraph([text("A good first step: "), mention(task, "Take the product tour"), text(".")]), + ]; const journal: WelcomeStarterEntity = { id: JOURNAL_ID, type: WelcomeEntityType.JournalEntry, - properties: { title: journalDateKey, ...ts }, - body: body([ - title(journalDateKey), - paragraph([text("Your first journal entry. Today you opened Brainstorm for the first time.")]), - paragraph([text("A good first step: "), mention(task, "Take the product tour"), text(".")]), - ]), + properties: { title: journalDateKey, ...denormalized(journalParagraphs), ...ts }, + body: body([title(journalDateKey), ...journalParagraphs]), }; // The hub note mentions every other starter entity so Graph paints a diff --git a/packages/shell/src/renderer/welcome/template-gallery.tsx b/packages/shell/src/renderer/welcome/template-gallery.tsx index ab844bbc..76b72095 100644 --- a/packages/shell/src/renderer/welcome/template-gallery.tsx +++ b/packages/shell/src/renderer/welcome/template-gallery.tsx @@ -46,7 +46,7 @@ export function TemplateGallery({

{t("shell.welcome.templates.heading")}

-

{t("shell.welcome.templates.hint")}

+

{t("shell.welcome.templates.hint")}

    {templates.map((template) => { const selected = template.id === selectedId; diff --git a/packages/shell/src/renderer/welcome/welcome-templates.test.tsx b/packages/shell/src/renderer/welcome/welcome-templates.test.tsx index 23a0c105..13170d93 100644 --- a/packages/shell/src/renderer/welcome/welcome-templates.test.tsx +++ b/packages/shell/src/renderer/welcome/welcome-templates.test.tsx @@ -117,6 +117,19 @@ function submit(): void { } describe("Welcome — template gallery", () => { + it("drops the brand hero on the Start step so the actions stay above the fold", async () => { + await act(async () => { + root.render(); + }); + await flush(); + expect(host.querySelector(".welcome__brand")).not.toBeNull(); + act(() => root.unmount()); + root = createRoot(host); + await enterCreateMode(); + expect(host.querySelector(".welcome__brand")).toBeNull(); + expect(host.querySelector(".welcome__step-title")).not.toBeNull(); + }); + it("renders a card per template once the list loads", async () => { await enterCreateMode(); expect(host.querySelector('[data-testid="welcome-templates"]')).not.toBeNull(); diff --git a/packages/shell/src/renderer/welcome/welcome.tsx b/packages/shell/src/renderer/welcome/welcome.tsx index 5b8942e3..22f9c164 100644 --- a/packages/shell/src/renderer/welcome/welcome.tsx +++ b/packages/shell/src/renderer/welcome/welcome.tsx @@ -193,11 +193,18 @@ export function Welcome() { : "welcome__content" } > -
    - -

    {t("shell.welcome.brand")}

    -
    -

    {t("shell.welcome.tagline")}

    + {/* The Start step carries its own heading and the tallest content + (seven template tiles): with the brand hero above it the card + outgrew a default window and "Create vault" sat below the fold. */} + {mode !== WelcomeMode.Start && ( + <> +
    + +

    {t("shell.welcome.brand")}

    +
    +

    {t("shell.welcome.tagline")}

    + + )} {mode === WelcomeMode.Menu && (
    From 5416281fb21b28f1bab3f647a60649939b267d6e Mon Sep 17 00:00:00 2001 From: brainstorm-os Date: Thu, 19 Nov 2026 14:44:12 +0100 Subject: [PATCH 3/4] =?UTF-8?q?fix(polish):=200.15.1=20=E2=80=94=20a=20scr?= =?UTF-8?q?een-by-screen=20pass=20over=20every=20app,=20in=20light=20and?= =?UTF-8?q?=20dark?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chat: day dividers key on the local calendar day (they keyed on the UTC date while the times beside them were local); both ⋯ buttons use the shared glyph. Books: one live progress value feeds the library row, the inspector and the footer; EPUBs drop the meaningless Pages row; the open inspector no longer covers the footer's next-page control. Browser: a restored blank tab shows the start page; short tab titles fit. Database: numeric header, cells and totals share one edge; type-list names split into words. SDK: an uncoloured chip is visible on light themes; an enabled header ⋯ rests at full strength. Files: Filter shares the toolbar field face; the sort menu fits its content; the selection bar is opaque and the list scrolls clear of it. Tasks: the checkbox ring holds 3:1 on dark themes. Journal, Mailbox: wording and an un-shouted account address. Adds the 0.15.1 What's New entry and bumps both package versions. Co-Authored-By: Claude Fable 5.2 --- apps/books/src/app.test.tsx | 17 ++ apps/books/src/app.tsx | 22 +- apps/books/src/logic/book-properties.test.ts | 22 +- apps/books/src/logic/book-properties.ts | 44 ++- apps/books/src/logic/library.test.ts | 20 ++ apps/books/src/logic/library.ts | 21 ++ apps/books/src/render/pdf-reader.ts | 12 +- apps/books/src/render/reader.test.ts | 29 ++ apps/books/src/render/reader.ts | 14 +- apps/books/src/styles.css | 28 +- apps/books/src/ui/inspector.tsx | 2 +- apps/browser/src/app-features.test.tsx | 34 ++- apps/browser/src/logic/persistence.test.ts | Bin 6335 -> 6763 bytes apps/browser/src/logic/persistence.ts | 8 +- apps/browser/src/styles.css | 5 +- apps/chat/src/app.tsx | 8 +- apps/chat/src/format.test.ts | 39 ++- apps/chat/src/format.ts | 9 +- apps/chat/src/logic/chat.test.ts | 58 +++- apps/chat/src/logic/chat.ts | 12 +- apps/chat/src/styles.css | 4 +- apps/database/src/styles.css | 25 +- apps/files/src/app.tsx | 8 +- apps/files/src/styles-toolbar-row.test.ts | 49 +++ apps/files/src/styles.css | 48 ++- apps/files/src/ui/dialogs.tsx | 4 +- apps/files/src/ui/filter-bar.tsx | 2 +- apps/graph/src/render/node-label.test.ts | 2 +- apps/journal/src/app.tsx | 2 +- apps/journal/src/i18n/de.json | 1 + apps/journal/src/i18n/en.json | 1 + apps/journal/src/i18n/es.json | 1 + apps/journal/src/i18n/fr.json | 1 + apps/journal/src/i18n/it.json | 1 + apps/journal/src/i18n/pt.json | 1 + apps/mailbox/src/styles.css | 4 + apps/tasks/src/styles.css | 4 +- package.json | 2 +- packages/sdk/src/app-theme.css | 6 + .../property-ui/dictionary-helpers.test.ts | 6 +- .../sdk/src/property-ui/dictionary-helpers.ts | 7 +- packages/sdk/src/system-entities.test.ts | 27 +- packages/sdk/src/system-entities.ts | 15 +- packages/shell/changelog/changelog.json | 281 ++++++++++++++++++ packages/shell/package.json | 2 +- 45 files changed, 827 insertions(+), 81 deletions(-) diff --git a/apps/books/src/app.test.tsx b/apps/books/src/app.test.tsx index 287318d8..1069b6f3 100644 --- a/apps/books/src/app.test.tsx +++ b/apps/books/src/app.test.tsx @@ -182,6 +182,23 @@ describe("BooksApp shelf", () => { expect(el.querySelector(".books__page")?.textContent).toContain("Anchor"); }); + // The inspector read the stored fraction as a bare number ("45") while the + // footer showed the live one ("23% read"); both now come from the reader. + it("shows the reader's live progress in the inspector, as a percentage", async () => { + const el = await renderApp(); + const footer = /(\d+)%/.exec(el.querySelector(".books__progress")?.textContent ?? "")?.[1]; + expect(footer).toBeDefined(); + expect(Number(footer)).toBeGreaterThan(0); + expect(el.querySelector(".bs-cell-progress-text")?.textContent).toBe(`${footer}%`); + }); + + it("carries no Pages row for a reflowable book — the footer owns the page count", async () => { + const el = await renderApp(); + const labels = [...el.querySelectorAll(".bs-props__row-label")].map((n) => n.textContent); + expect(labels).toContain("Progress"); + expect(labels).not.toContain("Pages"); + }); + // F-487 — the shared `.bs-props` inspector is `position: fixed`, so it // takes no layout space. Books centres a full-bleed reading measure under // it, so with the panel open every line ran on underneath: paragraphs read diff --git a/apps/books/src/app.tsx b/apps/books/src/app.tsx index da964549..d41b17f4 100644 --- a/apps/books/src/app.tsx +++ b/apps/books/src/app.tsx @@ -65,7 +65,7 @@ import { } from "./logic/book-open"; import { makePositionPersister, removeBookEntity, writeBookPatch } from "./logic/book-writes"; import { parseEpub } from "./logic/epub-parser"; -import { booksFromEntities } from "./logic/library"; +import { type LiveProgress, booksFromEntities, withLiveProgress } from "./logic/library"; import { type PdfInfo, pdfEnrichmentPatch } from "./logic/pdf-metadata"; import { SAMPLE_BOOK_CONTENT, sampleBook } from "./logic/sample-book"; import { type TocEntry, tocFromContent, tocFromPdfOutline } from "./logic/toc"; @@ -283,6 +283,7 @@ export function BooksApp(): ReactElement { const [openNonce, setOpenNonce] = useState(0); const [status, setStatus] = useState(ReaderStatus.Idle); const [toc, setToc] = useState([]); + const [liveProgress, setLiveProgress] = useState(null); const [showLibrary, setShowLibrary] = useState(true); const libraryAutoHide = useAutoHidePanel({ side: PanelSide.Left, collapsed: !showLibrary }); const [showInspector, setShowInspector] = useState(readInspectorPref); @@ -380,10 +381,13 @@ export function BooksApp(): ReactElement { ); const isSample = selectedId === SAMPLE_BOOK_ID; + const shelf = useMemo(() => withLiveProgress(books, liveProgress), [books, liveProgress]); const selectedBook = useMemo(() => { - if (isSample) return sample.current; - return selectedId ? (books.find((b) => b.id === selectedId) ?? null) : null; - }, [isSample, selectedId, books]); + if (isSample) { + return sample.current ? (withLiveProgress([sample.current], liveProgress)[0] ?? null) : null; + } + return selectedId ? (shelf.find((b) => b.id === selectedId) ?? null) : null; + }, [isSample, selectedId, shelf, liveProgress]); // PRES-3 — who's-here on the open book (vault rows only; not the sample). const bookPeers = usePresence( isSample ? null : (selectedBook?.id ?? null), @@ -461,6 +465,7 @@ export function BooksApp(): ReactElement { if (!stage || !controls) return undefined; setToc([]); + setLiveProgress(null); if (selectedId === null) { stage.replaceChildren(); @@ -468,9 +473,14 @@ export function BooksApp(): ReactElement { return undefined; } + const reportProgress = (progress: number): void => { + if (seq === openSeqRef.current) setLiveProgress({ bookId: selectedId, progress }); + }; + if (selectedId === SAMPLE_BOOK_ID) { const handle = mountReader(stage, controls, SAMPLE_BOOK_CONTENT, { bookId: SAMPLE_BOOK_ID, + onProgressChange: reportProgress, }); readerRef.current = { dispose: handle.dispose, goTo: handle.goTo }; setToc(tocFromContent(SAMPLE_BOOK_CONTENT)); @@ -522,6 +532,7 @@ export function BooksApp(): ReactElement { bookId: book.id, initialPosition: book.reading.position, onPositionChange: persist, + onProgressChange: reportProgress, }); readerRef.current = { dispose: handle.dispose, goTo: handle.goTo }; setToc(tocFromContent(content)); @@ -543,6 +554,7 @@ export function BooksApp(): ReactElement { const handle = mountPdfReader(stage, controls, title, port, { initialPosition: book.reading.position, onPositionChange: persist, + onProgressChange: reportProgress, onOpenLink: (url) => { // Route page links through the `open` intent so web URLs land // in the browser app (the registered `https` opener) — Books @@ -880,7 +892,7 @@ export function BooksApp(): ReactElement { data-inspector-open={selectedBook && subject && showInspector ? "true" : "false"} > { - it("maps author / format label / pages / 0-100 progress", () => { + it("maps author / format label / pages / whole-percent progress fraction", () => { const values = bookToValues(fixtureBook()); expect(values[BOOK_PROP_KEY.author]).toBe("Cal Newport"); expect(values[BOOK_PROP_KEY.format]).toBe("PDF"); expect(values[BOOK_PROP_KEY.pages]).toBe(12); - expect(values[BOOK_PROP_KEY.progress]).toBe(42); + expect(values[BOOK_PROP_KEY.progress]).toBe(0.42); }); it("hides the page count for a book without a measured spine", () => { @@ -56,8 +57,23 @@ describe("applyBookPropertyValue", () => { }); describe("bookPropertyDefs", () => { + // The bare-number cell rendered "45" beside a footer reading "45% read". + it("formats progress as a percentage over a 0..1 range", () => { + const def = bookPropertyDefs(BookFormat.Pdf).find((d) => d.key === BOOK_PROP_KEY.progress); + expect(def?.format).toBe(PropertyFormat.Percent); + expect(def?.range).toEqual({ min: 0, max: 1 }); + }); + + // An EPUB's spine length is its chapter-file count; the reflow reader + // paginates to the viewport, so "Pages 1" sat beside "Page 2 of 8". + it("omits the page count for a reflowable EPUB", () => { + const keys = bookPropertyDefs(BookFormat.Epub).map((d) => d.key); + expect(keys).not.toContain(BOOK_PROP_KEY.pages); + expect(keys).toContain(BOOK_PROP_KEY.progress); + }); + it("declares every value-map key exactly once", () => { - const keys = bookPropertyDefs().map((d) => d.key); + const keys = bookPropertyDefs(BookFormat.Pdf).map((d) => d.key); expect([...keys].sort()).toEqual(Object.values(BOOK_PROP_KEY).sort()); const values = bookToValues(fixtureBook()); for (const key of keys) expect(key in values).toBe(true); diff --git a/apps/books/src/logic/book-properties.ts b/apps/books/src/logic/book-properties.ts index 84d447f8..fdb48c5f 100644 --- a/apps/books/src/logic/book-properties.ts +++ b/apps/books/src/logic/book-properties.ts @@ -7,7 +7,12 @@ * position-persistence path, never edited by hand). */ -import { type PropertyDef, PropertyView, ValueType } from "@brainstorm-os/sdk-types"; +import { + type PropertyDef, + PropertyFormat, + PropertyView, + ValueType, +} from "@brainstorm-os/sdk-types"; import { t } from "../i18n"; import { type Book, BookFormat } from "../types/book"; @@ -18,19 +23,32 @@ export const BOOK_PROP_KEY = { progress: "progress", } as const; -export function bookPropertyDefs(): readonly PropertyDef[] { - return [ +/** The rows for a book of `format`. A reflowable EPUB has no page count of + * its own — its `spineLength` counts chapter files and the reader paginates + * to the viewport — so only a fixed-layout PDF carries the Pages row. */ +export function bookPropertyDefs(format: BookFormat): readonly PropertyDef[] { + const defs: PropertyDef[] = [ { key: BOOK_PROP_KEY.author, name: t("prop.author"), icon: null, valueType: ValueType.Text }, { key: BOOK_PROP_KEY.format, name: t("prop.format"), icon: null, valueType: ValueType.Text }, - { key: BOOK_PROP_KEY.pages, name: t("prop.pages"), icon: null, valueType: ValueType.Number }, - { - key: BOOK_PROP_KEY.progress, - name: t("prop.progress"), + ]; + if (format === BookFormat.Pdf) { + defs.push({ + key: BOOK_PROP_KEY.pages, + name: t("prop.pages"), icon: null, valueType: ValueType.Number, - display: { view: PropertyView.ProgressBar }, - }, - ]; + }); + } + defs.push({ + key: BOOK_PROP_KEY.progress, + name: t("prop.progress"), + icon: null, + valueType: ValueType.Number, + format: PropertyFormat.Percent, + range: { min: 0, max: 1 }, + display: { view: PropertyView.ProgressBar }, + }); + return defs; } export const READONLY_BOOK_PROP_KEYS: ReadonlySet = new Set([ @@ -44,14 +62,14 @@ const FORMAT_LABEL_KEYS = { [BookFormat.Epub]: "prop.format.epub", } as const; -/** Cell values for a book. Progress is 0..100 (the ProgressBar cell's - * default range). */ +/** Cell values for a book. Progress is the 0..1 fraction snapped to a whole + * percent, so the cell reads the same number as the shelf row and footer. */ export function bookToValues(book: Book): Record { return { [BOOK_PROP_KEY.author]: book.author, [BOOK_PROP_KEY.format]: t(FORMAT_LABEL_KEYS[book.format]), [BOOK_PROP_KEY.pages]: book.spineLength > 0 ? book.spineLength : null, - [BOOK_PROP_KEY.progress]: Math.round(book.reading.progress * 100), + [BOOK_PROP_KEY.progress]: Math.round(book.reading.progress * 100) / 100, }; } diff --git a/apps/books/src/logic/library.test.ts b/apps/books/src/logic/library.test.ts index 59cfb67d..b6a5e5e4 100644 --- a/apps/books/src/logic/library.test.ts +++ b/apps/books/src/logic/library.test.ts @@ -11,6 +11,7 @@ import { filterLibrary, isInProgress, sortLibrary, + withLiveProgress, } from "./library"; const SECTION_LABELS: LibrarySectionLabels = { @@ -185,3 +186,22 @@ describe("booksFromEntities", () => { expect(books[0]?.format).toBe(BookFormat.Pdf); }); }); + +// The footer measures progress against the LIVE pagination; the stored +// fraction was measured against whatever viewport last turned a page. Shown +// side by side they disagreed ("45%" in the row, "23% read" in the footer). +describe("withLiveProgress", () => { + const shelf = [reading("a", "A", 0.45, 10), reading("b", "B", 0.8, 20)]; + + it("shows the open book at the reader's live progress", () => { + const out = withLiveProgress(shelf, { bookId: "a", progress: 0.23 }); + expect(out.map((b) => b.reading.progress)).toEqual([0.23, 0.8]); + expect(out[0]?.reading.lastReadAt).toBe(10); + }); + + it("returns the same list when nothing is live or nothing differs", () => { + expect(withLiveProgress(shelf, null)).toBe(shelf); + expect(withLiveProgress(shelf, { bookId: "a", progress: 0.45 })).toBe(shelf); + expect(withLiveProgress(shelf, { bookId: "zzz", progress: 0.1 })).toBe(shelf); + }); +}); diff --git a/apps/books/src/logic/library.ts b/apps/books/src/logic/library.ts index 03c539ad..43a51370 100644 --- a/apps/books/src/logic/library.ts +++ b/apps/books/src/logic/library.ts @@ -146,6 +146,27 @@ export function continueReading(books: readonly Book[]): Book[] { return sortLibrary(books.filter(isInProgress), LibrarySort.Recent); } +/** The open book's progress as its mounted reader currently measures it. */ +export type LiveProgress = { bookId: string; progress: number }; + +/** Overlay the open reader's live progress onto the shelf. Progress is + * measured to the END of the visible page, so it depends on the pagination + * (viewport × typography) — the stored fraction is only true for the layout + * that last turned a page. Every surface that shows the open book's progress + * reads through this, so they cannot disagree with the reader footer. */ +export function withLiveProgress( + books: readonly Book[], + live: LiveProgress | null, +): readonly Book[] { + if (live === null) return books; + const index = books.findIndex((b) => b.id === live.bookId); + const book = books[index]; + if (!book || book.reading.progress === live.progress) return books; + const next = [...books]; + next[index] = { ...book, reading: { ...book.reading, progress: live.progress } }; + return next; +} + /** The persistence seam for per-book reading state. The reader calls * `saveReadingPosition` whenever the parked locator changes; the preview * drop leaves it unset (in-memory only), and 9.21.2 wires it to a diff --git a/apps/books/src/render/pdf-reader.ts b/apps/books/src/render/pdf-reader.ts index 2bbb7a83..70961b2e 100644 --- a/apps/books/src/render/pdf-reader.ts +++ b/apps/books/src/render/pdf-reader.ts @@ -75,6 +75,9 @@ export type PdfReaderOptions = { * with the stable locator + progress (0..1), mirroring the reflow * reader's contract so the host persists both modes identically. */ onPositionChange?: (locator: Locator, progress: number) => void; + /** Fired with the progress the footer shows whenever it changes, + * including on mount — mirrors the reflow reader. Display-only. */ + onProgressChange?: (progress: number) => void; /** Fired when a link in the page is clicked — the host opens it (web links * go to the browser via the `open` intent). Absent = links render but do * nothing on click. */ @@ -215,6 +218,8 @@ export function mountPdfReader( return isSpread() ? 2 : 1; } + let reportedProgress: number | null = null; + function paint(): void { if (disposed) return; applyView(); @@ -231,9 +236,14 @@ export function mountPdfReader( : t("reader.pageStatus", { page: String(state.pageIndex + 1), total }); status.textContent = pageStatus; leftCanvas.setAttribute("aria-label", `${title} — ${pageStatus}`); + const fraction = pdfProgress(state); progress.textContent = t("reader.progress", { - percent: String(Math.round(pdfProgress(state) * 100)), + percent: String(Math.round(fraction * 100)), }); + if (fraction !== reportedProgress) { + reportedProgress = fraction; + options.onProgressChange?.(fraction); + } prev.disabled = !canGoPrevPdf(state); next.disabled = !canGoNextPdf(state); if (state.pageCount <= 0) return; diff --git a/apps/books/src/render/reader.test.ts b/apps/books/src/render/reader.test.ts index e71ec2f3..d6732d33 100644 --- a/apps/books/src/render/reader.test.ts +++ b/apps/books/src/render/reader.test.ts @@ -104,6 +104,35 @@ describe("reader render with a measured page box", () => { }); }); +describe("reader live progress", () => { + const footerPercent = (root: HTMLElement): number => + Number(/(\d+)%/.exec(root.querySelector(".books__progress")?.textContent ?? "")?.[1]); + + // The footer was the only surface that knew the live number; the shelf row + // and the inspector showed the stored one until the next page turn. + it("reports the footer's progress on mount, before any page turn", () => { + const { root, right } = scaffold(); + const seen: number[] = []; + handle = mountReader(root, right, SAMPLE_BOOK_CONTENT, { + onProgressChange: (p) => seen.push(p), + }); + expect(seen).toHaveLength(1); + expect(Math.round((seen[0] ?? -1) * 100)).toBe(footerPercent(root)); + }); + + it("reports again when a page turn moves it, and stays in step with the footer", () => { + const { root, right } = scaffold(); + const seen: number[] = []; + handle = mountReader(root, right, SAMPLE_BOOK_CONTENT, { + onProgressChange: (p) => seen.push(p), + }); + root.querySelector(".books__nav-btn:last-of-type")?.click(); + expect(seen).toHaveLength(2); + expect(seen[1]).toBeGreaterThan(seen[0] ?? 1); + expect(Math.round((seen[1] ?? -1) * 100)).toBe(footerPercent(root)); + }); +}); + describe("reader render", () => { it("paints the typography controls + the first page content + page status", () => { const { root, right } = scaffold(); diff --git a/apps/books/src/render/reader.ts b/apps/books/src/render/reader.ts index 2f4bf761..0a140218 100644 --- a/apps/books/src/render/reader.ts +++ b/apps/books/src/render/reader.ts @@ -126,6 +126,11 @@ export type ReaderOptions = { * it. The preview drop leaves it unset (in-memory only). Mirrors * `onTypographyChange`. */ onPositionChange?: (locator: Locator, progress: number) => void; + /** Fired with the progress the footer shows whenever it changes — + * including on mount and on a re-pagination that moves no locator + * (progress is measured to the end of the visible page, so a resize + * changes it). Display-only: nothing is persisted off this. */ + onProgressChange?: (progress: number) => void; /** The book whose highlights these are — the `Highlight/v1.bookId`. */ bookId?: string; /** The highlight persistence seam. 9.21.6 wires these to `Highlight/v1` @@ -231,6 +236,8 @@ export function mountReader( } } + let reportedProgress: number | null = null; + function paint(): void { applyTypographyVars(); const current = currentPage(state); @@ -255,9 +262,14 @@ export function mountReader( page: String(state.pageIndex + 1), total: String(total), }); + const fraction = readingProgress(state); progress.textContent = t("reader.progress", { - percent: String(Math.round(readingProgress(state) * 100)), + percent: String(Math.round(fraction * 100)), }); + if (fraction !== reportedProgress) { + reportedProgress = fraction; + options.onProgressChange?.(fraction); + } prev.disabled = !canGoPrev(state); next.disabled = !canGoNext(state); } diff --git a/apps/books/src/styles.css b/apps/books/src/styles.css index 3b19375e..97d22b42 100644 --- a/apps/books/src/styles.css +++ b/apps/books/src/styles.css @@ -84,14 +84,19 @@ body { * open each line ran on underneath it: every paragraph appeared hard-cut * mid-word at the panel edge, and the glass blur turned the occluded tail of * each line into a grey bar inside the panel that read as a stuck loading - * skeleton beside "Author — Empty". Reserving the panel's width on the stage - * fixes both: the column recentres in the width that is actually visible. */ + * skeleton beside "Author — Empty". Reserving the panel's width fixes both: + * the column recentres in the width that is actually visible. + * + * The reservation sits on the reader ROOT, not the stage: the footer is the + * stage's sibling, so a stage-only inset left it full-bleed and its + * next-page button (the trailing end of a space-between row) under the panel. + * Padding keeps the page background running beneath the glass. */ .books__layout { --books-inspector-width: 320px; } -.books__layout[data-inspector-open="true"] .books__stage { - padding-inline-end: calc(var(--space-4) + var(--books-inspector-width)); +.books__layout[data-inspector-open="true"] .books { + padding-inline-end: var(--books-inspector-width); } .books__content { @@ -387,6 +392,15 @@ body { padding-top: 0; } +/* The shared progress cell is `width: 100%` plus a -4px inline margin (a + * hover bleed for its editable face). As a growing flex item that makes it + * 8px wider than the value column, so its trailing number ran past the + * panel padding. Books' progress is read-only — no hover face to bleed. */ +:root .books__props .bs-cell-progress { + margin-inline: 0; + padding-inline: 0; +} + /* Separate the table of contents from the property rows with the same 1px divider the meta footer uses, so CONTENTS reads as its own section. */ .books__toc { @@ -451,6 +465,9 @@ body { flex-direction: column; flex: 1 1 auto; min-height: 0; + /* Matches the inspector's own slide transition so the column glides to + * its new centre instead of jumping. */ + transition: padding-inline-end var(--motion-duration-normal, 180ms) ease; background: var(--reader-bg, var(--bg)); color: var(--reader-text, var(--text)); --reader-font-family: var(--text-family-body, var(--text-family-ui)); @@ -547,9 +564,6 @@ body { display: flex; justify-content: center; padding: var(--space-6) var(--space-4); - /* Matches the inspector's own slide transition so the column glides to - * its new centre instead of jumping. */ - transition: padding-inline-end var(--motion-duration-normal, 180ms) ease; } .books__page { diff --git a/apps/books/src/ui/inspector.tsx b/apps/books/src/ui/inspector.tsx index 1642412c..2b5434ed 100644 --- a/apps/books/src/ui/inspector.tsx +++ b/apps/books/src/ui/inspector.tsx @@ -56,7 +56,7 @@ export function BookInspector({ onClose, }: BookInspectorProps): ReactElement { const values = bookToValues(book); - const rows: PropertiesPanelRow[] = bookPropertyDefs().map((def) => { + const rows: PropertiesPanelRow[] = bookPropertyDefs(book.format).map((def) => { const locked = readOnly || READONLY_BOOK_PROP_KEYS.has(def.key); const row: PropertiesPanelRow = { def, value: values[def.key], readOnly: locked }; if (!locked) { diff --git a/apps/browser/src/app-features.test.tsx b/apps/browser/src/app-features.test.tsx index 853a7243..0a53028c 100644 --- a/apps/browser/src/app-features.test.tsx +++ b/apps/browser/src/app-features.test.tsx @@ -22,7 +22,7 @@ import { BrowserApp } from "./app"; import { type HistoryVisit, historyRecordToProperties } from "./logic/history"; import { PERSIST_DEBOUNCE_MS, sessionRecordToProperties } from "./logic/persistence"; import type { EntityRecord } from "./runtime"; -import type { BrowsingSessionRecord } from "./types/browsing-session"; +import { type BrowsingSessionRecord, NEW_TAB_URL } from "./types/browsing-session"; const popupStateListeners = vi.hoisted(() => [] as Array<(open: boolean) => void>); vi.mock("@brainstorm-os/sdk/menus", async (importOriginal) => ({ @@ -326,6 +326,38 @@ describe("BrowsingSession/v1 restore", () => { expect(webView.bounds.some((b) => b.tabId === restoredOpen?.tabId)).toBe(true); }); + it("shows the start page when the restored ACTIVE tab is a blank new tab", async () => { + const stored = storedRecord(); + const record: BrowsingSessionRecord = { + ...stored, + tabs: [ + ...stored.tabs, + { + id: "old-3", + url: NEW_TAB_URL, + title: "", + faviconUrl: null, + pinned: false, + history: [], + historyIndex: -1, + }, + ], + activeTabId: "old-3", + }; + install([{ ...sessionRow(), properties: sessionRecordToProperties(record) }]); + await render(); + await act(async () => {}); + + expect(tabTitles()).toEqual(["Tab A", "Tab B", "New tab"]); + expect(container.querySelector(".browser-start")).not.toBeNull(); + const restoredOpen = webView.opened.at(-1); + expect(restoredOpen?.url).toBe(NEW_TAB_URL); + // The native view composites above the chrome, so it must be parked or + // it covers the start page. + const lastBounds = webView.bounds.filter((b) => b.tabId === restoredOpen?.tabId).at(-1); + expect(lastBounds?.rect).toEqual({ x: 0, y: 0, width: 0, height: 0 }); + }); + it("keeps a fresh session when nothing was stored", async () => { await render(); await act(async () => {}); diff --git a/apps/browser/src/logic/persistence.test.ts b/apps/browser/src/logic/persistence.test.ts index 6aa0dd7d4a3dffc74dd6ab5270db83b0f9b5e06a..a29e4cab928cb943a72095d30acc3b9d8bcd000d 100644 GIT binary patch delta 382 zcmYjN%}T>S5Js@n#*+vYdm4IbAgNS~V63PC4+T+ZBO+4jrdg83x*K+W_N2yW4B&Og>F;k3(eX0}_yhleu29{AdJGmTs z$L{c=cdF4Z)gykNlUPLpE#u|pbNO6~2@hXfrIvjd<#w9;D^1R0Ol#3q3&{xClzPPP{s(KZ qsee$(w#v25*5I(IdzeiWE^QRb%sZvWwbjBRd#mmh@%+2`zVrjfUVPL5 delta 59 zcmaEDvfprm8CywZL8?OaXfRXq_lat#1TdSctR8L diff --git a/apps/browser/src/logic/persistence.ts b/apps/browser/src/logic/persistence.ts index fb48a250..eda4efaf 100644 --- a/apps/browser/src/logic/persistence.ts +++ b/apps/browser/src/logic/persistence.ts @@ -16,7 +16,7 @@ import { sanitizeInlineText } from "@brainstorm-os/sdk/sanitize-text"; import type { BrowsingSessionRecord, TabSnapshot } from "../types/browsing-session"; -import { MAX_RECENTLY_CLOSED } from "../types/browsing-session"; +import { MAX_RECENTLY_CLOSED, NEW_TAB_URL } from "../types/browsing-session"; import { isWebUrl } from "./external-open"; /** Per-tab history bound in the persisted record — a long-lived tab's @@ -86,7 +86,11 @@ function parseTab(input: unknown): TabSnapshot | null { : currentEntry !== undefined && isWebUrl(currentEntry) ? Math.max(history.indexOf(currentEntry), 0) : history.length - 1; - const url = isWebUrl(raw.url) ? raw.url : (history[historyIndex] ?? ""); + // A tab with nothing web to restore IS a blank new tab: the chrome keys the + // start page (and parking the native view under it) on `NEW_TAB_URL`, so an + // empty string here restored a tab that showed neither a page nor the start + // page. + const url = isWebUrl(raw.url) ? raw.url : (history[historyIndex] ?? NEW_TAB_URL); return { id: raw.id, url, diff --git a/apps/browser/src/styles.css b/apps/browser/src/styles.css index cbe101a6..ba3d16aa 100644 --- a/apps/browser/src/styles.css +++ b/apps/browser/src/styles.css @@ -63,7 +63,10 @@ body { align-items: center; gap: var(--space-1, var(--space-1)); height: 30px; - min-width: 96px; + /* Floor sized for the chrome (12 + 14 favicon + 8 + 4 + 18 close + 4) plus a + * short title: at 96px only ~36px was left and "New tab" ellipsised to + * "Ne…" beside 190px neighbours. The strip scrolls, so a floor is safe. */ + min-width: 128px; max-width: 220px; padding: 0 var(--space-1, var(--space-1)) 0 var(--space-3, var(--space-3)); border-radius: var(--radius-md); diff --git a/apps/chat/src/app.tsx b/apps/chat/src/app.tsx index 4fd0cbf2..711d0e60 100644 --- a/apps/chat/src/app.tsx +++ b/apps/chat/src/app.tsx @@ -865,7 +865,9 @@ export function ChatApp(): ReactElement { aria-haspopup="menu" onClick={openMore} > - + + +
    @@ -1280,7 +1282,9 @@ function MessageView({ openMessageMenu({ x: r.right, y: r.bottom + 4 }, m, el); }} > - + + + ) : null} {m.richBody ? ( diff --git a/apps/chat/src/format.test.ts b/apps/chat/src/format.test.ts index a4f0ead9..422bee9b 100644 --- a/apps/chat/src/format.test.ts +++ b/apps/chat/src/format.test.ts @@ -1,8 +1,9 @@ -import { describe, expect, it } from "vitest"; +import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { formatDay, formatStamp, formatTime } from "./format"; +import { dayKey } from "./logic/chat"; describe("chat time formatting (Chats-3)", () => { - const now = new Date("2026-06-20T15:00:00.000Z"); + const now = new Date(2026, 5, 20, 15, 0, 0); it("labels today / yesterday by default", () => { expect(formatDay("2026-06-20", false, now)).toBe("Today"); @@ -27,3 +28,37 @@ describe("chat time formatting (Chats-3)", () => { expect(formatDay("nope", true)).toBe("nope"); }); }); + +describe("day divider agrees with the displayed time", () => { + const savedTz = process.env.TZ; + afterAll(() => { + if (savedTz === undefined) Reflect.deleteProperty(process.env, "TZ"); + else process.env.TZ = savedTz; + }); + + describe.each(["Europe/Berlin", "America/Los_Angeles", "Pacific/Auckland"])("in %s", (tz) => { + beforeAll(() => { + process.env.TZ = tz; + }); + + it("labels the divider with the same local date the timestamp shows", () => { + for (const iso of ["2026-08-01T22:53:00.000Z", "2026-08-02T06:30:00.000Z"]) { + const local = new Date(iso); + const expected = local.toLocaleDateString("en", { + weekday: "long", + year: "numeric", + month: "short", + day: "numeric", + }); + expect(formatDay(dayKey(iso), true, local)).toBe(expected); + } + }); + + it("calls a message sent just after local midnight Today, not Yesterday", () => { + const iso = "2026-08-01T22:53:00.000Z"; + const now = new Date(Date.parse(iso) + 60_000); + expect(formatDay(dayKey(iso), false, now)).toBe("Today"); + expect(formatDay(dayKey("2026-07-31T22:53:00.000Z"), false, now)).toBe("Yesterday"); + }); + }); +}); diff --git a/apps/chat/src/format.ts b/apps/chat/src/format.ts index 22d16dea..c6b4e791 100644 --- a/apps/chat/src/format.ts +++ b/apps/chat/src/format.ts @@ -32,10 +32,11 @@ export function formatStamp(iso: string): string { /** A day-divider label: Today / Yesterday / a localized date. With `absolute` * (Chats-3) the relative labels give way to the full date. */ export function formatDay(dayKey: string, absolute = false, now: Date = new Date()): string { - const ms = Date.parse(dayKey); - if (!Number.isFinite(ms)) return dayKey; - const that = new Date(ms); - const startOf = (d: Date) => Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()); + const parts = /^(\d{4})-(\d{2})-(\d{2})$/.exec(dayKey); + if (!parts) return dayKey; + // A bare `YYYY-MM-DD` parses as UTC midnight; the key is a LOCAL day. + const that = new Date(Number(parts[1]), Number(parts[2]) - 1, Number(parts[3])); + const startOf = (d: Date) => Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()); const diffDays = Math.round((startOf(now) - startOf(that)) / 86_400_000); if (!absolute) { if (diffDays === 0) return t("day.today"); diff --git a/apps/chat/src/logic/chat.test.ts b/apps/chat/src/logic/chat.test.ts index 62fb9e3e..c623d301 100644 --- a/apps/chat/src/logic/chat.test.ts +++ b/apps/chat/src/logic/chat.test.ts @@ -6,7 +6,7 @@ import { RosterRole, SenderKind, } from "@brainstorm-os/sdk-types"; -import { describe, expect, it } from "vitest"; +import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { AUTHOR_COLORS, CHANNEL_TYPE, @@ -187,14 +187,14 @@ describe("groupMessages", () => { ref: "p1", name: "Mira", body: "a", - createdAt: "2026-06-20T23:59:00Z", + createdAt: new Date(2026, 5, 20, 23, 59, 0).toISOString(), seq: 0, }), message("m2", "c", { ref: "p1", name: "Mira", body: "b", - createdAt: "2026-06-21T00:00:30Z", + createdAt: new Date(2026, 5, 21, 0, 0, 30).toISOString(), seq: 1, }), ], @@ -207,6 +207,54 @@ describe("groupMessages", () => { }); }); +describe("day grouping follows the local calendar day", () => { + const color = (ref: string) => `color-${ref}`; + const savedTz = process.env.TZ; + beforeAll(() => { + process.env.TZ = "Europe/Berlin"; + }); + afterAll(() => { + if (savedTz === undefined) Reflect.deleteProperty(process.env, "TZ"); + else process.env.TZ = savedTz; + }); + + it("keys a just-after-local-midnight message to the new day", () => { + expect(new Date("2026-08-01T22:53:00.000Z").getHours()).toBe(0); + expect(dayKey("2026-08-01T20:11:00.000Z")).toBe("2026-08-01"); + expect(dayKey("2026-08-01T22:53:00.000Z")).toBe("2026-08-02"); + }); + + it("splits a group at local midnight even inside one UTC day", () => { + const rows = channelMessages( + [ + message("m1", "c", { + ref: "p1", + name: "Mira", + body: "late", + createdAt: "2026-08-01T21:58:00.000Z", + seq: 0, + }), + message("m2", "c", { + ref: "p1", + name: "Mira", + body: "after midnight", + createdAt: "2026-08-01T22:01:00.000Z", + seq: 1, + }), + ], + "c", + ); + expect(groupMessages(rows, color).map((g) => g.dayKey)).toEqual(["2026-08-01", "2026-08-02"]); + }); + + it("keeps one local day together across a UTC date change", () => { + process.env.TZ = "America/Los_Angeles"; + expect(dayKey("2026-08-01T23:30:00.000Z")).toBe("2026-08-01"); + expect(dayKey("2026-08-02T00:30:00.000Z")).toBe("2026-08-01"); + process.env.TZ = "Europe/Berlin"; + }); +}); + describe("membersFromMessages", () => { it("lists distinct authors in first-seen order", () => { const rows = channelMessages( @@ -316,8 +364,8 @@ describe("initials", () => { }); describe("dayKey", () => { - it("returns the UTC date portion of an ISO stamp", () => { - expect(dayKey("2026-06-20T10:00:00.000Z")).toBe("2026-06-20"); + it("returns the local calendar date of an ISO stamp", () => { + expect(dayKey(new Date(2026, 5, 20, 10, 0, 0).toISOString())).toBe("2026-06-20"); expect(dayKey("nope")).toBe("nope"); }); }); diff --git a/apps/chat/src/logic/chat.ts b/apps/chat/src/logic/chat.ts index a358f495..dd40ae25 100644 --- a/apps/chat/src/logic/chat.ts +++ b/apps/chat/src/logic/chat.ts @@ -240,10 +240,16 @@ export function nextSeq(messages: readonly ChatMessage[]): number { // ─────────────────────────────── grouping ─────────────────────────────── -/** `YYYY-MM-DD` (UTC) of an ISO timestamp; "" when unparseable. */ +/** `YYYY-MM-DD` of an ISO timestamp in the viewer's LOCAL calendar — the same + * zone the message time renders in, so a divider can never disagree with the + * stamps beneath it. An unparseable stamp is returned as-is. */ export function dayKey(iso: string): string { - const idx = iso.indexOf("T"); - return idx > 0 ? iso.slice(0, idx) : iso; + const ms = Date.parse(iso); + if (!Number.isFinite(ms)) return iso; + const d = new Date(ms); + const month = String(d.getMonth() + 1).padStart(2, "0"); + const day = String(d.getDate()).padStart(2, "0"); + return `${d.getFullYear()}-${month}-${day}`; } /** Messages within this many ms by the same author collapse into one group. */ diff --git a/apps/chat/src/styles.css b/apps/chat/src/styles.css index e0ed59bd..4637f4a1 100644 --- a/apps/chat/src/styles.css +++ b/apps/chat/src/styles.css @@ -834,7 +834,9 @@ body { height: 24px; opacity: 0; background: var(--bg-elev); - border: 1px solid var(--border-subtle); + border: 1px solid var(--border-strong); + color: var(--text); + gap: var(--space-0_5); } .chat__line-wrap:hover .chat__line-more, diff --git a/apps/database/src/styles.css b/apps/database/src/styles.css index 153b75ed..29278f15 100644 --- a/apps/database/src/styles.css +++ b/apps/database/src/styles.css @@ -1054,6 +1054,10 @@ body.is-resizing .db-inspector__resize { align-items: baseline; gap: var(--space-2); max-width: 100%; + /* The hover face bleeds into the cell padding so the label itself ends on + * the cell's content edge — the edge the header label and the numeric + * values above it share. */ + margin-inline: calc(-1 * var(--space-1)); padding: 0 var(--space-1); border: 0; background: transparent; @@ -1170,6 +1174,17 @@ body.is-resizing .db-inspector__resize { text-align: end; } +/* The shared faces bleed 6px (pill) / 4px (plain) past the cell padding and + * inset their text 2px, which lands a right-aligned value 4px / 2px outside + * the cell's content edge. Trailing bleed = the face's own inset, so the + * numerals end exactly on the edge the header label and footer use. */ +.dbv-grid__cell--numeric > .bs-cell-pill, +.dbv-grid__cell--numeric > .bs-cell-plain, +.dbv-grid__cell--numeric .bs-cell-plain-input, +.dbv-grid__cell--numeric .bs-cell-input { + margin-inline-end: calc(-1 * var(--space-0_5)); +} + .dbv-grid__cell--numeric .bs-cell-plain-input, .dbv-grid__cell--numeric .bs-cell-input { text-align: end; @@ -1382,7 +1397,9 @@ body.is-resizing .db-inspector__resize { background: var(--bg); } -.dbv-grid[data-pinned="true"] .dbv-grid__row:not(.dbv-grid__row--head):hover .dbv-grid__cell[data-col="title"] { +.dbv-grid[data-pinned="true"] + .dbv-grid__row:not(.dbv-grid__row--head):not(.dbv-grid__row--foot):hover + .dbv-grid__cell[data-col="title"] { background: linear-gradient(var(--hover), var(--hover)), var(--bg); } @@ -1395,6 +1412,12 @@ body.is-resizing .db-inspector__resize { background: var(--bg-elev); } +/* The footer band is `--bg-elev` like the header; left on the pinned cell's + * page colour, the title cell read as a grey block set 12px into a white band. */ +.dbv-grid[data-pinned="true"] .dbv-grid__row--foot .dbv-grid__cell[data-col="title"] { + background: var(--bg-elev); +} + /* ── List view ────────────────────────────────────────────────────────── */ .dbv-list { diff --git a/apps/files/src/app.tsx b/apps/files/src/app.tsx index bf82fc0c..9da96926 100644 --- a/apps/files/src/app.tsx +++ b/apps/files/src/app.tsx @@ -59,7 +59,7 @@ import { hasActiveFilters } from "./logic/filters"; import { buildPreviewSiblings } from "./logic/preview-siblings"; import { ScopeFlipAction, SearchScope, flipScope } from "./logic/search"; import type { SmartFolder } from "./logic/smart-folders"; -import { SortDirection, SortKey } from "./logic/sort"; +import { SortKey } from "./logic/sort"; import { ActionId, chordFor } from "./shortcuts"; import { type FilesStore, useFilesStore } from "./store/use-files-store"; import { type Entity, FILE_TYPE, FOLDER_TYPE, readName } from "./types/entity"; @@ -765,11 +765,7 @@ export function FilesApp() { {t("brainstorm.files.sort.label")}: {sortLabel(store.sortKey)} - + className="view-switch" diff --git a/apps/files/src/styles-toolbar-row.test.ts b/apps/files/src/styles-toolbar-row.test.ts index 01a312b9..78ab70b1 100644 --- a/apps/files/src/styles-toolbar-row.test.ts +++ b/apps/files/src/styles-toolbar-row.test.ts @@ -116,3 +116,52 @@ describe("files toolbar is one control row", () => { ).not.toMatch(/bs-(select|input|btn)--sm/); }); }); + +describe("files toolbar end group is one face", () => { + const css = readFileSync(CSS_PATH, "utf8"); + const tsx = readFileSync(APP_PATH, "utf8"); + const filterTsx = readFileSync(join(SRC_DIR, "ui", "filter-bar.tsx"), "utf8"); + + it("the Filter toggle wears the same field face as Sort-by and the view picker", () => { + const className = /className="([^"]*\btoolbar__filter\b[^"]*)"/.exec(filterTsx)?.[1] ?? ""; + expect(className.split(" "), "Filter must wear the shared .bs-select face").toContain( + "bs-select", + ); + expect( + className, + "a transparent .bs-btn--secondary beside two white fields reads as a disabled control", + ).not.toMatch(/bs-btn/); + }); + + it("the Sort-by trigger shows the dropdown caret, never the sort direction", () => { + const trigger = /data-testid="toolbar-sort"[\s\S]*?<\/button>/.exec(tsx)?.[0]; + expect(trigger, "could not locate the sort trigger JSX").toBeDefined(); + expect(trigger).toContain("IconName.CaretDown"); + expect(trigger, "an up caret on a closed menu reads as an open one").not.toContain("CaretUp"); + }); + + it("the view-options menu is not held to the small panel's 480px cap and shows scroll shadows", () => { + const panel = onlyBody(css, ".bs-popover__panel:has(.sort-menu__items)"); + expect(panel).toMatch(/max-height:\s*80vh/); + const body = onlyBody(css, ".bs-popover__body:has(> .sort-menu__items)"); + expect(body, "the covers must scroll with the content").toMatch(/\blocal\b/); + expect(body, "the edge shadows must stay pinned to the scrollport").toMatch(/\bscroll\b/); + }); +}); + +describe("files bulk-action bar does not sit on the content", () => { + const css = readFileSync(CSS_PATH, "utf8"); + + it("the bar is an opaque surface", () => { + const body = onlyBody(css, ".files-bulkbar"); + expect(body).toMatch(/background:\s*var\(--color-background-elevated\)/); + expect(body, "glass lets the tiles underneath read through the labels").not.toMatch( + /glass-background|backdrop-filter/, + ); + }); + + it("the list reserves the bar's footprint while the bar is shown", () => { + const body = onlyBody(css, ".content-list:has(~ .files-bulkbar)"); + expect(body).toMatch(/padding-bottom:/); + }); +}); diff --git a/apps/files/src/styles.css b/apps/files/src/styles.css index 9d753059..b18ef247 100644 --- a/apps/files/src/styles.css +++ b/apps/files/src/styles.css @@ -499,9 +499,17 @@ body[data-nav-open="false"] .sidebar:not([data-bs-autohide]) { padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border: var(--border-width) solid var(--color-glass-border, var(--border)); border-radius: var(--radius-full); - background: var(--color-glass-background-strong); + /* Opaque, like the shared popover panel: the bar floats over tiles with no + * scrim, and the glass fill let their titles read through its labels. */ + background: var(--color-background-elevated); box-shadow: var(--shadow-xl); - backdrop-filter: blur(12px); +} + +/* The bar overlays the list's last visible row; while it is up the scroller + * gains the bar's footprint (bottom offset + 46px pill + breathing room) so + * the final row can scroll clear of it. */ +.content-list:has(~ .files-bulkbar) { + padding-bottom: calc(var(--space-4) * 2 + 46px); } .files-bulkbar__count { @@ -615,9 +623,16 @@ body[data-nav-open="false"] .sidebar:not([data-bs-autohide]) { color: var(--accent); } +/* The Filter toggle wears the `.bs-select` field face, like Sort-by and the + * view picker beside it: as a transparent `.bs-btn--secondary` with dim ink it + * read as a disabled control next to two white fields. Pressed (filter row + * open) borrows the face's own open-state edge. */ .toolbar__filter { flex-shrink: 0; - gap: var(--space-1); +} + +.toolbar__filter[aria-pressed="true"] { + border-color: var(--color-accent-default); } /* Property-filter row + the Duplicates summary (9.8.16) — a second band @@ -1678,8 +1693,9 @@ body:not([data-inspector="open"]) .inspector { * picker are the SAME `.bs-select` face (one boxed trigger face per * toolbar; chrome from `@brainstorm-os/sdk/select-menu.css`). The sort button * keeps its own popover (direction + group-by + layout controls, not a plain - * option list) — only its face is the shared one; its caret shows the current - * sort direction instead of the dropdown caret. */ + * option list) — only its face is the shared one, dropdown caret included + * (a direction caret pointed UP on a closed menu beside the view picker's + * down caret; the direction is drawn on the menu's own direction row). */ .toolbar__sort-label { max-width: 220px; @@ -1691,6 +1707,28 @@ body:not([data-inspector="open"]) .inspector { gap: var(--space-0_5); } +/* The view-options menu is longer than the shared small panel's 480px cap + * (sort + direction + group + tile size + columns), so it always scrolls — + * and macOS overlay scrollbars hide the only cue, leaving a row sliced by the + * panel edge. Let the panel use the height the window has, and paint scroll + * shadows: the opaque covers ride the content (`local`) and slide off the + * edge shadows (`scroll`) whenever more rows lie beyond that edge. */ +.bs-popover__panel:has(.sort-menu__items) { + max-height: 80vh; +} + +.bs-popover__body:has(> .sort-menu__items) { + background: + linear-gradient(var(--color-background-elevated) 40%, transparent) top / 100% var(--space-6) + no-repeat local, + linear-gradient(transparent, var(--color-background-elevated) 60%) bottom / 100% var(--space-6) + no-repeat local, + linear-gradient(var(--color-border-strong), transparent) top / 100% var(--space-2) no-repeat + scroll, + linear-gradient(transparent, var(--color-border-strong)) bottom / 100% var(--space-2) no-repeat + scroll; +} + .sort-menu__item { display: flex; align-items: center; diff --git a/apps/files/src/ui/dialogs.tsx b/apps/files/src/ui/dialogs.tsx index 3cb317dc..e8a658da 100644 --- a/apps/files/src/ui/dialogs.tsx +++ b/apps/files/src/ui/dialogs.tsx @@ -170,8 +170,8 @@ export type SortMenuProps = { onClose: () => void; }; -/** The direction row's state glyph: the same caret the toolbar trigger shows, - * so "which way is it sorting" reads identically in both places. */ +/** The direction row's state glyph — the one place the sort direction is + * drawn. The toolbar trigger's caret is the dropdown affordance, not this. */ export function directionIcon(direction: SortDirection): IconName { return direction === SortDirection.Asc ? IconName.CaretUp : IconName.CaretDown; } diff --git a/apps/files/src/ui/filter-bar.tsx b/apps/files/src/ui/filter-bar.tsx index 35669ffa..18bec413 100644 --- a/apps/files/src/ui/filter-bar.tsx +++ b/apps/files/src/ui/filter-bar.tsx @@ -61,7 +61,7 @@ export function FilterToggleButton({ return (