From 55f9652f6a07a39f417f023b8f8131bc99a16ded Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Thu, 19 Nov 2026 20:26:23 -0600 Subject: [PATCH] fix(webui): settings-s5 review P2-1: while an organization needs a restart its Models page leaves out Stop using your models, as the org-models-restart mockup does, since buttons here have no disabled look; the shots add the model service not set up state (#1873, lane settings-s5) --- packages/webui/src/public/bus.js | 5 +++-- packages/webui/tests/settings-s5-browser.test.mjs | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/webui/src/public/bus.js b/packages/webui/src/public/bus.js index 4f3b54ac2..677333b90 100644 --- a/packages/webui/src/public/bus.js +++ b/packages/webui/src/public/bus.js @@ -1385,8 +1385,9 @@ const change=!read?'':restartFirst?`

You can change ${whose} models after it restarts.

` :on?`

Its agents can use the models your accounts offer. To switch back, press Stop using your models. A route on one of your models then stops working until you change it.

` :`

Choose Use your models to switch. ${Whose} agents can then use the models your accounts offer. While your model service is down, a launch that needs it is refused. A running agent keeps its model until it starts again.

${modelsService()}`; - // P2-1: while the organization needs a restart every control here waits, Stop included. - const stop=on?``:''; + // P2-1: while the organization needs a restart every control here waits. Stop is left out, as in + // the mockup, since a disabled button here looks no different from an enabled one. + const stop=on&&!restartFirst?``:''; const again=harnessSettings===false?'':''; // P3-1: Use your models has no button of its own, so its write shows Saving in the status line. const status=modelsBusy&&!on?' Saving…':txt(modelsReceipt); diff --git a/packages/webui/tests/settings-s5-browser.test.mjs b/packages/webui/tests/settings-s5-browser.test.mjs index 25b23aacf..3ead75556 100644 --- a/packages/webui/tests/settings-s5-browser.test.mjs +++ b/packages/webui/tests/settings-s5-browser.test.mjs @@ -194,8 +194,8 @@ test('settings-s5: an organization that needs a restart shows the banner with Re assert.equal(await b.evaluate('!!(document.querySelector("#routes-catalogue").compareDocumentPosition(document.querySelector("#models-source")) & Node.DOCUMENT_POSITION_FOLLOWING)'), true); assert.equal(await b.evaluate('document.querySelector("#models-yours").checked && document.querySelector("#models-yours").disabled'), true); assert.equal(await text('#models-wait'), "You can change Acme Studio's models after it restarts."); - // Review P2-1: Stop using your models waits too. - assert.equal(await b.evaluate('document.querySelector("#models-stop").disabled'), true); + // Review P2-1: Stop using your models waits too: it is not offered until the restart. + assert.equal(await b.evaluate('!!document.querySelector("#models-stop")'), false); // One primary: the routes Save is quiet. assert.equal(await b.evaluate('document.querySelector("#routes-form [type=submit]").classList.contains("route-save-quiet")'), true); }); @@ -378,6 +378,8 @@ test('shots', { timeout: 900000, skip: !process.env.MOSAIC_UX_SHOTS }, async t = { name: 'org-models', path: '/#/settings/routing?org=acme', ready: 'document.querySelector("#models-in-force")?.textContent.includes("does not use")' }, { name: 'org-models-riding', path: '/#/settings/routing?org=acme', ready: 'document.querySelector("#models-in-force")?.textContent.includes("does not use")', after: async (b, wait) => { await b.evaluate('document.querySelector("#models-yours").click(); true'); await wait('/^Saved/.test(document.querySelector("#models-receipt")?.textContent ?? "")'); } }, + { name: 'org-models-not-set-up', path: '/#/settings/routing?org=acme', stub: { service: { ...SERVICE_UP, init: { initialized: false, partial: false, problem: null, files: [] } } }, + ready: 'document.querySelector("#models-service") && document.querySelector("#models-in-force")?.textContent.includes("does not use")' }, { name: 'org-models-restart', path: '/#/settings/routing?org=acme', fixture: { routes: { acme: { catalogue: { status: 'unavailable', notices: [], models: [] } } } }, stub: { plugins: pluginsRead(['fixture', 'cliproxy']) }, ready: 'document.querySelector("#routes-catalogue.banner [data-primary]") && document.querySelector("#models-in-force")?.textContent.startsWith("Now: Acme Studio uses")' }, { name: 'account-reasons', path: '/#/settings/model-setup?step=accounts', stub: { accounts: reasons }, ready: 'document.querySelectorAll("#proxy-accounts .account-reason").length === 2' },