Skip to content

experimental theme: a whole-theme border color reaches the fields' edge at the nearest shade that keeps 3:1... - #12763

Merged
josephfarina merged 1 commit into
feature/theme-editorfrom
josephfarina/editor-field-edge-border
Nov 21, 2026
Merged

josephfarina merged 1 commit into
feature/theme-editorfrom
josephfarina/editor-field-edge-border

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

User impact

astryx experimental theme editor set <theme> --color-border <color>: a whole-theme border color also moves the edge the fields draw (the token the census reads for their border color, today --color-border-emphasized) to that color where it reads at 3:1 on the field's fill, else to the nearest shade of it that does, in each mode, so "thin light gray borders" reach inputs and selectors while they keep a boundary people can see. The result names the shade ("fields kept at 3:1"), with the line that gives fields the exact color; a field edge the theme sets itself keeps its value; one undo takes both back.

Problem and solution fit

The theme editor is experimental. Each change is one behaviour of its set or how commands, with its own test, and touches nothing outside packages/cli/api/theme-edit.

Smallest restoration

  • .changeset/experimental-theme-field-edge-follows-border.md | 7 ++
  • packages/cli/api/theme-edit/_settings.mjs | 132 +++++++++++++++++-----------
  • packages/cli/api/theme-edit/theme-border-follows.test.mjs | 9 +-
  • .../cli/api/theme-edit/theme-field-edge-follows-border.test.mjs | 108 +++++++++++++++++++++++
  • .../api/theme-edit/theme-token-family-follows-fills.test.mjs | 17 +++-

Evidence

Tests on this layer (CI=1, applied on its base in order):

  • packages/cli/api/theme-edit/theme-border-follows.test.mjs
  • packages/cli/api/theme-edit/theme-field-edge-follows-border.test.mjs
  • packages/cli/api/theme-edit/theme-token-family-follows-fills.test.mjs

The whole packages/cli/api/theme-edit suite on the top of this stack fails only what its base fails in the same environment (app-copy and compile-check fixtures); eslint and prettier are clean on the changed files.

Scope

Components: theme editor (CLI, experimental)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

preflight: pass f67054e (review deferred to batch: subagent cap)

@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 21, 2026 5:50am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 19, 2026
@astracat-bot

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 21, 2026, 5:32 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs an owner decision, and two fixes either way. No current record governs the theme editor writing a 3:1 field edge into the shared --color-border-emphasized token, and architecture:theme-tokens INV13 and DEC-2 give fields a dedicated --color-border-control and rejected raising --color-border-emphasized to 3:1 because other parts darken with it (on a neutral-based theme, --color-border #e5e7eb moves it from #d4d4d4 to #939498 for blockquote, card, divider, kbd key and others). An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. If the shared write stays, the "fields kept at 3:1" note should also name those other parts.

Blocking findings:

  • The branch is built on an older copy of theme-r15-p22: it conflicts with the base in five files and carries 21 commits already on it, so rebase the field-edge commit onto the current base, where it applies cleanly.
  • The note's exact-color line (packages/cli/api/theme-edit/_settings.mjs:7871) has no astryx experimental theme editor prefix and leaves the hex unquoted, so pasted into a shell #e5e7eb starts a comment and the command runs with no value; build it with P and quoteCommandArgument like the file's other command lines.
Claims and files checked

Review mode: full; reason: no-earlier-review

  • A whole-theme border color moves the fields' edge to the color or its nearest 3:1 shade in each mode: verified (_settings.mjs:7857-7873; the new field-edge test passes).
  • The result names the shade with a line that gives fields the exact color: false as a runnable line (_settings.mjs:7871 drops its value in a shell).
  • A field edge the theme sets itself keeps its value: verified (pinned check at _settings.mjs:7858; the test that keeps a set field edge passes).
  • One undo takes both back: verified (field-edge test).
  • The change is five files and touches nothing outside the theme-edit folder: false for this compare, which has 33 files from 21 carried commits, two CLI docs and a test-timing file among them.
  • The listed tests pass: verified (3 files, 14 tests at this head).
  • The theme-edit suite fails only what its base fails, and lint and formatting are clean: not rechecked.
  • The six carried changesets (bar height, checkbox size, corners, picture traits, plural looks, page color) belong to commits already on the base and were not judged here.
  • Files: _settings.mjs (the exact-color line finding, plus the note that follows the owner decision); _check.mjs, _how-question.mjs, theme-checks-size.test.mjs, .changeset/experimental-theme-how-checks-size.md (conflicts); the field-edge changeset and its three tests: clear; the other 24 files: clear here, identical to commits already on the base.

Automated review (maintainer link)

putTok(edge.token, shade, m);
if (shade.toLowerCase() !== String(border).toLowerCase())
(ctx.compileNotes ??= []).push(
`fields kept at 3:1: their edge (${edge.token}) is ${shade} in ${m} mode, the nearest shade of ${border} that reads on their fill; for the exact color: \`set ${data.name} ${edge.token} ${border}${data.mode === 'both' ? ` --mode ${m}` : ''}\``,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is not runnable as printed: it has no astryx experimental theme editor prefix (the other ${P} set lines in this file include it), and the unquoted hex starts a shell comment, so set p --color-border-emphasized #e5e7eb --mode light runs with no value. Suggest ${P} set ${data.name} ${edge.token} ${quoteCommandArgument(border)}${...}.

if (!fill) continue;
const shade = shadeAt(border, String(fill), 3);
if (!shade) continue;
putTok(edge.token, shade, m);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

putTok writes the shade theme-wide. On today's Core the field-edge token is --color-border-emphasized, which blockquote, calendar day, card, clickable card, kbd key, divider and the dropdown-menu radio also read, so they darken too (on a neutral-based theme, #d4d4d4 to #939498 for --color-border #e5e7eb), while the note says only "fields". Whether that is intended is an owner decision (architecture:theme-tokens INV13/DEC-2); either scope the write to fields or name those parts in the note.

@josephfarina
josephfarina force-pushed the theme-r15-p22 branch 25 times, most recently from 81fa0fd to b12e2d7 Compare November 19, 2026 08:12
@josephfarina
josephfarina force-pushed the theme-r15-p22 branch 26 times, most recently from 8d14a0a to edd42ef Compare November 19, 2026 22:46
…ge at the nearest shade that keeps 3:1 on their fill

This branch was successfully deployed

1 active deployment
Preview — f67054eb Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant