0aaff91ebd
* feat(ui): add installed model lifecycle Models now owns catalog exploration and installed runtime controls under one canonical route. URL-owned state keeps lifecycle context recoverable through links and browser history. Assisted-by: Codex:gpt-5 Playwright * feat(ui): add installed backend lifecycle Backends split discovery from backend-binary management. The canonical page now keeps both lifecycle views under one URL-backed shell while it preserves target-node placement. Assisted-by: Codex:gpt-5 Playwright * fix(ui): repair lifecycle state updates Installed models lost distributed refreshes and kept a deleted selection. Backend searches also stopped tracking URL changes, while batch upgrades stopped after their first error. Preserve background refreshes and finish each requested batch action. Drive catalog results from URL-backed state without losing full metadata. Assisted-by: Codex:gpt-5 [Playwright] * feat(ui): make resource pages canonical Replace Host navigation with canonical Models and Backends lifecycle routes, preserve legacy management URLs, and surface shared host capacity on the Operate overview. Assisted-by: Codex:gpt-5 [Playwright] * feat(ui): complete canonical resource lifecycle Finish the responsive list-to-detail behavior, remove the retired Host implementation, and keep Explore focused on discovery while Installed owns destructive actions. Update regression coverage, localization, documentation, and development binding for the canonical resource pages. Assisted-by: Codex:gpt-5 [Playwright] * docs(ui): record the UI design context Record the approved users, brand character, and design principles so future interface work uses the same product direction. Index the context from the repository's agent instructions. Assisted-by: Codex:gpt-5 --------- Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
57 lines
2.3 KiB
JavaScript
57 lines
2.3 KiB
JavaScript
import { test, expect } from './coverage-fixtures.js'
|
|
|
|
function urlState(page) {
|
|
const url = new URL(page.url())
|
|
return { path: url.pathname, params: url.searchParams }
|
|
}
|
|
|
|
test.describe('Canonical resource navigation', () => {
|
|
test('redirects legacy model management state and replaces browser history', async ({ page }) => {
|
|
await page.goto('/app')
|
|
await page.goto('/app/manage?tab=models&sel=alpha&mq=alp&mf=running')
|
|
|
|
await expect.poll(() => urlState(page).path).toBe('/app/models')
|
|
const state = urlState(page)
|
|
expect(state.params.get('view')).toBe('installed')
|
|
expect(state.params.get('model')).toBe('alpha')
|
|
expect(state.params.get('q')).toBe('alp')
|
|
expect(state.params.get('state')).toBe('running')
|
|
|
|
await page.goBack()
|
|
await expect(page).toHaveURL(/\/app\/?$/)
|
|
})
|
|
|
|
test('redirects legacy backend management state including visibility flags', async ({ page }) => {
|
|
await page.goto('/app/manage?tab=backends&sel=llama-cpp&bq=llama&bf=user&bv=1&bd=1')
|
|
|
|
await expect.poll(() => urlState(page).path).toBe('/app/backends')
|
|
const state = urlState(page)
|
|
expect(state.params.get('view')).toBe('installed')
|
|
expect(state.params.get('backend')).toBe('llama-cpp')
|
|
expect(state.params.get('q')).toBe('llama')
|
|
expect(state.params.get('state')).toBe('user')
|
|
expect(state.params.get('show_all')).toBe('1')
|
|
expect(state.params.get('development')).toBe('1')
|
|
})
|
|
|
|
test('defaults legacy management links to Installed Models', async ({ page }) => {
|
|
await page.goto('/app/manage')
|
|
|
|
await expect.poll(() => urlState(page).path).toBe('/app/models')
|
|
expect(urlState(page).params.get('view')).toBe('installed')
|
|
})
|
|
|
|
test('names the canonical sidebar destination Models and removes Host from Operate', async ({ page }) => {
|
|
await page.goto('/app')
|
|
|
|
const sidebar = page.locator('.sidebar-nav')
|
|
await expect(sidebar.getByRole('link', { name: 'Models', exact: true })).toBeVisible()
|
|
await expect(sidebar.getByRole('link', { name: 'Discover', exact: true })).toHaveCount(0)
|
|
|
|
await sidebar.getByRole('link', { name: 'Operate', exact: true }).click()
|
|
const operateRail = page.locator('.console-rail')
|
|
await expect(operateRail.getByRole('link', { name: /Backends/ })).toBeVisible()
|
|
await expect(operateRail.getByRole('link', { name: /Host/ })).toHaveCount(0)
|
|
})
|
|
})
|