lablup / lablup/backend.ai-webui
Branding page: import a v1 theme.json and export it as a v2 appearance document
- Dominant language
- TypeScript
- Stars
- 133
- Forks
- 81
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 355
Description
## Background
Since FR-3605 (PR #9361) the appearance loader reads the **v2** document only (`schemaVersion: 2`, `{ theme, branding `}). A legacy v1 `theme.json` (antd-shaped `light`/`dark` token blocks) fails schema validation and is not applied — the app falls back to the Astryx neutral theme with a console error. Operators with an existing v1 document have no in-product path to migrate it.
## Goal
On the Branding page, accept an existing v1 `theme.json`, convert it to the v2 structure, and let the operator export (download) the converted document.
## Scope
- Import: file picker / paste for a v1 document; detect the v1 shape (`light.token`, `dark.token`, `components.Layout.headerBg`, logo fields).
- Convert to v2: `colorPrimary/colorLink/colorInfo/colorError/colorSuccess` → `theme.families.default.seeds.{accent,link,info,error,success`} as `[light, dark]` tuples (dark values as declared — no darkAlgorithm re-mapping), `fontFamily` → `theme.fontFamily`, `Layout.headerBg` → `families.default.headerBg`, logo/company fields → `branding`; drop v1 keys that have no consumer (see the FR-3605 v1 → v2 field map).
- Validate the result against `resources/theme.schema.json`; surface validation errors instead of silently defaulting.
- Preview in the Branding editor and export the v2 JSON.
## Acceptance
- A v1 document produces a v2 JSON that the loader accepts without console errors.
- Validation failures are shown to the operator with the offending path.
- Dark values in the export equal the declared v1 dark seeds (no transform).
## References
- FR-3605 / PR #9361 — v2 appearance document, theme-shim retirement, migration field map in the PR body.
JIRA Issue: FR-3847
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Branding page/editor and the migration field map in FR-3605 / PR #9361, then inspect resources/theme.schema.json for the v2 shape and validation paths. Implement the v1 import, preview, validation-error reporting, and export flow; done means the loader accepts the exported v2 JSON, errors identify offending paths, and dark seeds remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100