feat(rendered-views): add the shared token layer and the branding setting

Đang mở
#19,170 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
28/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
css, html, javascript
Lĩnh vực
full-stack, tooling

Hướng nghiên cứu

Start with ADR 0133 and the named entry points: lib/html-chrome.html, lib/view-settings.mjs, the builder's page policy and validator, and the rendered-views contract, registry and schema. Then inspect existing tests and the SVG allowlist, plugin option naming convention, and chrome regeneration process. Done means implementing the listed branding resolution and validation behavior, updating the contract and generated chrome copies, and passing tests for resolution order, refusals and contrast floors.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

ADR 0133 (docs/adr/0133-let-a-consumer-brand-rendered-pages-through-one-shared-token-layer.md)
lets a consumer override the palette, type stacks and logo of every rendered page, but nothing
implements it. The chrome's palette and stacks are literal values in lib/html-chrome.html:37-84,
lib/view-settings.mjs resolves only medium, and no file holds the shipped token values for a
plugin to copy. Every migration slice depends on this one.

Done when

  • lib/html-tokens.css holds the shipped values for the palette roles (bg, fg, panel, muted, accent, link, focus) in both schemes and the serif, sans and mono stacks, and lib/html-chrome.html takes its values from it with no visible change.
  • lib/view-settings.mjs resolves a branding key from the personal override, the team file and the lane plugin's userConfig, in that order, and reports the layer behind each value.
  • The resolver accepts colors only as six-digit hex, font families only from a closed character set, a logo as an SVG that passes the builder's SVG allowlist or as a PNG or JPEG file, plus a text label, and brand font files (WOFF2, WOFF, TTF, OTF); it reads each embedded file itself, checks its magic bytes against the allowed media types and writes it as a data: URL. An invalid value is reported and ignored without dropping another layer's value.
  • The builder's page policy gains img-src data: and font-src data: and nothing else, and the validator admits a data: URL only in the logo slot (image/png, image/jpeg) and in @font-face (font media types); every other url(, scheme and URL-bearing attribute stays refused, with tests for each refusal. (Owner decision on #16412, 2026-11-25, accepting this widening; verbatim: "go w/ recommendations"; row: https://github.com/melodic-software/architecture/blob/d08dfddce2f0e94072f19c3a122a8c8c25cdb08f/docs/owner-decisions.md#L436)
  • In both schemes, the resolver checks every pair an overridable role takes part in: fg, muted and link text on bg and on panel at 4.5:1, and the focus outline on bg and on panel at 3:1 (ADR 0133, Decision 3). It drops an override that fails any of its pairs, keeps the shipped value, and prints a notice naming the role, scheme, pair and ratio.
  • A lane passing --team-ref reads branding from that commit.
  • The branding key and its schema are added to the rendered-views contract's settings section, the rendered-views row of the config-cascade registry, and the rendered-views schema.
  • The userConfig option shape for the per-user value follows docs/conventions/plugin-option-naming.
  • The chrome's header comment no longer states the old "no team or user theme override" rule, and the four chrome copies are regenerated with their plugins bumped.
  • Tests cover resolution order, each validation refusal, and the floor check.

Related

  • Refs: #16412 (design and decisions)
  • Blocks every rendered-views branding migration item filed from #16412
Ngôn ngữ chính
Shell
Star
22
Fork
2
Merge trung bình
2 giờ
Pull request đã merge (30 ngày)
960

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của melodic-software/claude-code-plugins

Tất cả issue của melodic-software/claude-code-plugins

Issue tương tự

Thêm issue về Shell/Bash

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.