Repository navigation
refactor(design): fewer, truer rules — MUST only for observable defects - #501
Merged
Merged
Conversation
…ypography Studied pbakaus/impeccable (and Motionsites-AI/claude-skill) and kept what holds up against our own guide. Guide (design/DESIGN.md, Chinese translation, npm guide, agent plugin copy): - Name the surface's mode: tools and documents spend expression on precision; a persuading page commits to one signature idea. - Leading at least 1.5, text a reader needs at least 12px, more space above a heading than below; balanced headings and pretty paragraphs. - Browser surfaces (selection, caret, focus, scrollbars, tabular numerals) carry the design. - "Defaults to refuse": a label that repeats its heading, nested cards, icon-tile grids, gradient text, glow, decorative glass, ghost cards, motion that reports nothing; generic marketing copy. - Rank findings P0-P3 and write fixes as values, not adjectives. Checks: - verify:design gains gradient-text and overshoot-easing (the latter enforces the guide's existing "decelerate without overshoot"). Existing overshoot in checkbox and r-glass is recorded in the baseline. - design-checklist.spec checks measure, leading, minimum text size and heading spacing on the key pages at 320px and 1280px. Docs site: themed selection and caret; inline code and the playground's copy button no longer drop below 12px. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying ran with
|
| Latest commit: |
490713a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5e4737a7.ran-4ty.pages.dev |
| Branch Preview URL: | https://feat-design-lessons.ran-4ty.pages.dev |
The standards had grown more rules than the defects behind them, and the same rule was restated in several places that no longer agreed. - Guide: MUST is only for a defect a user can observe; SHOULD is a starting point to depart from with a reason. The brief is written down only for pages being built or restructured. Animation bans layout properties rather than everything but transform and opacity. A modal rule replaces the adapter's dead "navigation-layer" link. The "defaults to refuse" list becomes one line: decoration has to do a job. - verify:design: drop gradient-text and overshoot-easing; both were taste, and contrast is already a MUST. - Adapter: correct radius (xs 4, sm 8, xl 24), link (blue-800, dark #5b9dff), primary hover/active and dark bg-elevated; drop rules owned by CODING.md and orphan lines; process MUSTs become SHOULD; spring and bouncy are a host's expressive choice, never a component default. - CODING.md / CLAUDE.md: replace dead "DESIGN.md §n" references. - Public design-system and design-guides pages, all eight languages: correct gray-alpha, dark overrides, focus ring, spacing and motion values. A new test compares the documented values with the theme files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- verify:design: a line that breaks a rule on purpose says so with `design-ok: <rule> <reason>`; a missing reason does not count. spacing-scale asks the library to name its steps as tokens and everyone else only to stay on the 4px scale (the docs baseline drops by 16). - Guide: from Don't Make Me Think, count how hard each choice is rather than how many clicks; self-evident before self-explanatory; anything clickable looks clickable at rest; accept input as people type it and ask only what the task needs; watch three people try the task and fix the worst problem with the smallest change. - Home page: drop the three kickers that repeated their headings. - checkbox and r-glass settle on the standard curve instead of overshooting. - design-guides page, all eight languages: an explainer that links to the guide and the adapter instead of restating them (266 to ~165 lines). - The interface-guidance test follows the adapter's new spacing section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- docs.interface-guidance read the adapter's spacing section by splitting on "\n## ranui spacing\n", which a Windows checkout (CRLF) never matches. - "pages do not shift while they load" fails on Linux CI for /ranui/select/ at 0.092, on main since #500 as well, but measures 0.001 locally in every order tried. The failure message now lists each shift's elements and movement, so the next run says where to look. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ift coverage
From an independent review of this PR:
- docs.css: inserting the selection and caret rules also replaced
`.search__input:focus-visible {`, leaving a stray descendant selector and
a duplicate global block. Restored.
- design-ok exceptions: a trailing comment no longer excuses the next line
(the line above counts only when it holds nothing but a comment), and the
reason must start with a word, so "design-ok: spacing-scale -" fails.
- The value-drift test now also compares dark values in token rows, every
token/value pair in a row (the spacing table), light and dark shadows,
and inline "`--ran-x` (value)" figures; a mutation of each kind is caught.
- The shift report names SVG nodes by their class attribute.
- Adapter: copy's line height is `--ran-line-height` (1.5715), not "1.55".
- Guide: one list again under Visual language; Chinese says 小标签.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d scripts Ideas from JimLiu/baoyu-design's design workflow, rewritten in our words (its methodology is derived from a product system prompt, so no text is copied): - Guide: compare two or three directions side by side in one place before committing to a new page; don't fill space with invented sections, stats or icons; for mixed scripts put Latin first with a CJK or Arabic fallback, mark `lang`, give CJK running text 1.7–1.8 leading, pair a Latin serif with a CJK serif. - Design skill: ask for a reference when the direction is open; ask before adding sections, pages or copy the request did not include. - Docs site: Chinese, Japanese and Korean running text gets 1.75 leading (was 1.65, the Latin value); headings and English pages are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A review of the whole design standard, prompted by studying pbakaus/impeccable and Motionsites-AI/claude-skill. Direction: keep rules that prevent a defect a user can observe; turn taste and process into starting points an agent may depart from with a reason; fix values that had drifted between copies.
Please review manually; not for auto-merge. Two commits: the first adds lessons from impeccable, the second trims them back after evaluation and fixes drift.
Guide (
design/DESIGN.md+ Chinese translation, npm guide and plugin copies synced)text-wrap: balance/pretty; theme browser surfaces (selection, caret, scrollbars, tabular numerals).Adapter (
packages/ranui/docs/adapters/DESIGN.md, rewritten)xs 4 · sm 8 · md 12 · lg 16 · xl 24; linkblue-800(dark#5b9dff); primary hover/active#2a2a2e/#3f3f46(dark#d4d4d8/#b4b4bb); darkbg-elevated#18181b; added--ran-color-focus.var(), z-index on the host, overlay shadow tier, overlay re-measure, wrapper raised only while painting).ease-spring/ease-bouncyare a host's expressive choice, never a component default.Checks
verify:designis unchanged from main (9 rules). Thegradient-textandovershoot-easingrules added in the first commit were removed: both were taste.design-checklist.spec.ts: measure, leading, minimum text size and heading spacing on 11 key pages at 320px and 1280px.docs.design-tokens.test.ts: now also compares documented values withtokens.less/dark.lessin all eight design-system pages (it only checked names, which is how gray-alpha and the focus ring drifted).Docs site
design-systemanddesign-guidespages, all eight languages: gray-alpha, dark overrides, focus ring, spacing (24–32px between regions) and motion ranges corrected; intro points at the real sources.::selectionand caret; inline code floors at 12px; playground copy button 12px.#d9d9d9advice corrected.Third commit
design-ok: <rule> <reason>; no reason, no exception (unit-tested).8pxis fine. Docs spacing debt drops from 51 to 35.checkboxandr-glass; restated rules on thedesign-guidespage in all eight languages (now an explainer that links to the guide and adapter).docs.interface-guidance.test.tsfollows the adapter's new spacing section (it failed CI on the second commit).Later commits
.search__input:focus-visible(a replacement had broken it);design-okcovers only its own line and needs a worded reason; the value-drift test also checks dark values, every pair in a row, shadows and inline figures (each kind mutation-tested); shift diagnostics name SVG nodes correctly; Windows CRLF fix in a test.pages do not shiftfailure (/ranui/select/, 0.092; 2 of the last 6 runs, also on main) now reports what moved when it fails.Verification
pnpm verify:design(ranui, docs): 9 rules, no new violations; baselines equal main.pnpm verify:docs(design sync, plugin, generated docs,check:langs) andpnpm verify:links: pass.docs.design-tokens.test.ts: 11 passed (fails on main's pages: it caught 11 drifted values per locale).tscclean; docs unit 252; full docs build with anchor checks over 1316 pages; 140 docs browser tests on Chromium; home page viewed after removing the kickers.🤖 Generated with Claude Code