From c9b5d0ff5cfaa34f3ad3f387d5d79bc471588f23 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Wed, 4 Nov 2026 22:00:22 +0000 Subject: [PATCH] test(ui): give the packaged add-on mock plain titles and let the Settings tabs scroll The add-on manifests now carry the title and description as language maps. packagedApp copied the map into the title field, which the apps list sends as plain English text, so the sidebar, the drawer and the Home slash menu drew nothing for Studio and Talk. It now sends the English text in title and description and the maps in titles and descriptions, as the server does. The Settings tab strip scrolls sideways on a phone by design, and it outgrew 390 px when the Memory tab was added. Allow it in the overflow spec like the other tab strips. Assisted-by: Claude:claude-sonnet-5-5 --- core/http/react-ui/e2e/no-horizontal-overflow.spec.js | 5 +++-- core/http/react-ui/e2e/studio-addon.js | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/core/http/react-ui/e2e/no-horizontal-overflow.spec.js b/core/http/react-ui/e2e/no-horizontal-overflow.spec.js index 06c14bec85..2df05f90df 100644 --- a/core/http/react-ui/e2e/no-horizontal-overflow.spec.js +++ b/core/http/react-ui/e2e/no-horizontal-overflow.spec.js @@ -16,8 +16,9 @@ import { mockLedger, GALLERY } from './ledger-fixtures.js' const WIDTHS = [390, 768] // Boxes that scroll on their own, by selector. -// The strips are one row of tabs or chips that scroll on a phone by design. -const SCROLLS_INSIDE = ['pre', 'code', 'table', '.ag-pre', '.wk-shortcuts__chips', '.st-groups'] +// The strips are one row of tabs or chips that scroll on a phone by design +// (the Settings tabs outgrow 390 px with a wider font). +const SCROLLS_INSIDE = ['pre', 'code', 'table', '.ag-pre', '.wk-shortcuts__chips', '.st-groups', '.dk-hubtabs'] const join = (n, s) => Array.from({ length: n }, (_, i) => `${s}${i}`).join('_') const WORD = join(9, 'unbroken_name_segment') diff --git a/core/http/react-ui/e2e/studio-addon.js b/core/http/react-ui/e2e/studio-addon.js index 15a2a3ca58..a3017e1fa8 100644 --- a/core/http/react-ui/e2e/studio-addon.js +++ b/core/http/react-ui/e2e/studio-addon.js @@ -38,14 +38,20 @@ function build(id) { return built.get(id) } +// The text of a manifest field: a plain string, or a language map. The apps +// list sends the English text in title and description, and the whole map in +// titles and descriptions. +const english = v => (v && typeof v === 'object' ? v.en : v) +const languages = v => (v && typeof v === 'object' ? v : undefined) + export function packagedApp(id, over = {}) { const manifest = JSON.parse(fs.readFileSync(path.join(addons, id, 'manifest.json'), 'utf8')) const ui = manifest.capabilities.ui const base = `/api/addons/${id}/assets/${DIGEST}` return app({ - id, name: id, title: ui.title, description: ui.description, icon: undefined, generation: 1, version: manifest.version, + id, name: id, title: english(ui.title), description: english(ui.description), titles: languages(ui.title), descriptions: languages(ui.description), icon: undefined, generation: 1, version: manifest.version, mainPage: `/app/addons/${id}/${ui.mainPage}`, tools: [], toolCount: 0, - ui: { entry: `${base}/${ui.entry}`, css: ui.css.map(c => `${base}/${c}`), sdk: ui.sdk, pages: ui.pages, navigation: ui.navigation, modelActions: ui.modelActions, homeCommands: ui.homeCommands?.map(c => ({ ...c, page: c.page || ui.mainPage, label: c.label || ui.title, icon: c.icon || 'puzzle' })) }, + ui: { entry: `${base}/${ui.entry}`, css: ui.css.map(c => `${base}/${c}`), sdk: ui.sdk, pages: ui.pages, navigation: ui.navigation, modelActions: ui.modelActions, homeCommands: ui.homeCommands?.map(c => ({ ...c, page: c.page || ui.mainPage, label: c.label || english(ui.title), icon: c.icon || 'puzzle' })) }, ...over, }) }