Files
mudler-agentandEttore Di Giacinto 0a44303c21 fix(addons): one page title, one primary action and clearer empty states (#12850)
A visual pass over the add-on pages found the same few problems on
several of them. Fix them with one rule per problem instead of page by
page.

Titles: every add-on page takes the host page-title size. Talk and Tables
no longer shrink it, Studio draws one "Studio" title above its tabs (the
card of a generator is a section), and Voice keeps one title on all its
tabs. The Text to speech tab gets a styled form. The "not available"
page shows the add-on name, not the lowercase id, and sits at the same
inset as an add-on page.

One primary action: the empty state of a list carries the add button, so
the header button waits until there is something in the list (Voice
library, enrolling a speaker or a person, Add rows). The Add-ons page
shows one way into Browse. A table with no columns says so once.

Tables: Share is hidden when there are no named accounts. The active
table tab is highlighted and an empty tab list leaves no gap before
"New table".

Studio: the tab strip stays on one row at 1280 wide, /studio/3d opens
the 3D tab, and an input chip has a divider between its label and its
placeholder.

Fine-tune and Quantize: the Experimental badge sits beside the lede, not
inside the h1; an open step shows its number instead of an empty circle;
the sticky action bar keeps a gap above it.

The footer shows nothing for the empty version of a source build, and
the Voice Text to speech tab says where to get a model when none is
installed.

Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
2026-10-23 12:35:44 +02:00

24 lines
1.1 KiB
JavaScript

import test from 'node:test'
import assert from 'node:assert/strict'
import { addRowsPlace, canShare } from '../src/lib/layout.js'
test('layout: Share is offered only where the installation has named accounts', () => {
assert.equal(canShare({ sharing: true }), true)
assert.equal(canShare({ sharing: false }), false)
assert.equal(canShare({}), false)
assert.equal(canShare(null), false)
})
test('layout: a table with no rows offers Add rows once, in its empty state', () => {
const base = { canWrite: true, columnCount: 2, loaded: true, rowCount: 0, filtered: false }
assert.equal(addRowsPlace(base), 'empty')
assert.equal(addRowsPlace({ ...base, rowCount: 3 }), 'toolbar')
assert.equal(addRowsPlace({ ...base, filtered: true }), 'toolbar')
assert.equal(addRowsPlace({ ...base, loaded: false }), 'toolbar')
})
test('layout: a reader, or a table with no columns, is offered no Add rows', () => {
assert.equal(addRowsPlace({ canWrite: false, columnCount: 2, loaded: true, rowCount: 0, filtered: false }), 'none')
assert.equal(addRowsPlace({ canWrite: true, columnCount: 0, loaded: true, rowCount: 0, filtered: false }), 'none')
})