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
This commit is contained in:
Ettore Di Giacinto committed 2026-11-04 22:00:22 +00:00
1 parent 8ec12b740a
commit c9b5d0ff5c
2 files changed
+11 -4

No files matched your search

@@ -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')
+8 -2
View File
@@ -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,
})
}