Skip to content

Studio alignment: foundation — @/ alias, primitive APIs, shared hooks and lib #2204

Closed

Description

@peppescg

Parent: #2210. Depends on #2201.

Outcome

Studio carries the prototype's shared foundation, so feature ports become copy-and-adapt rather than rewrite.

Scope

  • @/ import alias. Add it in apps/web/tsconfig*.json and vite.config.ts. Prototype files then drop in with formatting-only changes. Decide this before further ports, so imports aren't rewritten twice.
  • Primitive API convergence with the prototype (apps/web/src/components/ui/ on stack/08-tooling):
    • card: CardAction, data-slot, and the @container header.
    • table: built-in sortable head and nested rows (ChevronIndicator). Then retire sortable-head.tsx and move its call sites.
    • tooltip: onlyWhenTruncated with use-is-truncated. It replaces native title= attributes.
    • badge: settle the status ink colour.
    • input: the aria-invalid, file: and selection: states.
  • Self-contained hooks and lib modules, with tests: use-confirm, use-prompt, use-beforeunload-guard, use-is-truncated, useIsCompact, clipboard, formatters, document-title, error-message, file-meta, line-diff.
    • Replace the ad-hoc navigator.clipboard call sites.
    • Fold the inlined line diff in skill-diff.tsx into line-diff.
  • Stays as it is: Studio's styles.css tokens, the appearance store, palettes, storage keys, and the boot script.
    • Cherry-pick only the prototype's hide-scrollbar, the iOS body-background fix, and the thinking-bounce keyframes.
    • Decide whether the root font size becomes 100% (respect the browser setting) or stays 16px.

Acceptance

  • Ported files differ from the prototype only by imports, formatting, and Studio tokens.
  • Existing call sites are migrated.
  • task studio:check passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    WebUIenhancementux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions