Skip to content

🧷 test: Count Derived Scrim Tokens as Theme-Owned - #16512

Merged
berry-13 merged 1 commit into
canaryfrom
berry-13/fix-scrim-token-ownership
Sep 29, 2026
Merged

berry-13 merged 1 commit into
canaryfrom
berry-13/fix-scrim-token-ownership

Conversation

@berry-13

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

Canary's Tests: @librechat/client lane fails tokens.spec.ts > lets a theme set every color token the stylesheet declares. #16480 added that check, requiring every --color-* token in tokens.css to be a theme key of its own; #16492, which landed just before it, added scrim, scrim-alert and scrim-modal, which compose the surface-overlay role with a scrim opacity role and so are not keys themselves. Each pull request was green on its own base; together they leave canary red, and every PR based on canary inherits the failure (#16483, #16484).

The check now reads the custom properties each token's value references, and counts a token as theme-owned when one of them is a property a theme can set. The scrims pass through surface-overlay; a token that reads only an unregistered property, directly or through a derived value, still fails.

Test-only change; no runtime behavior changes.

Type of change

  • Tests / tooling / CI

Testing

Tested environments/configuration:

  • Not applicable: Jest only.

Automated tests:

  • packages/client: npx jest src/theme/tokens.spec.ts fails on canary (unowned scrim, scrim-alert, scrim-modal) and passes with this change.
  • Mutation check: adding --color-bogus: rgb(var(--bogus)) and --color-bogus-scrim: rgb(var(--bogus) / var(--theme-scrim-opacity, 0.8)) to tokens.css makes the check report both.
  • Full packages/client suite with npx jest, plus eslint, prettier --check and sort-imports --check on the spec.

Screenshots / recordings

No user-facing change.

Risk / compatibility

None.

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors

The stylesheet-ownership check added in #16480 required every declared
color token to be a theme key of its own, so the scrim tokens from #16492,
which compose the surface-overlay role with a scrim opacity role, failed it
once both landed on canary. A token is now owned when a variable its value
reads is one a theme can set.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T15:54:04.537520Z 8468ff3 PR opened
🔒 Security Review ✅ Completed 2026-09-29T15:52:27.325501Z 8468ff3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Lighthouse CI failed. The last 80 log lines contain the measured budgets and assertion failures.

│ 23      │ 'http://localhost:3080/api/permissions/mcpServer/effective/all'                                                 │ 3003.2369999999646 │ 3763.48199999996   │ 200    │
│ 24      │ 'http://localhost:3080/api/prompts/groups?limit=10'                                                             │ 3003.4980000000214 │ 4270.569000000018  │ 200    │
│ 25      │ 'http://localhost:3080/api/keys?name=openAI'                                                                    │ 3287.3649999999907 │ 3915.698999999964  │ 200    │
│ 26      │ 'http://localhost:3080/api/presets'                                                                             │ 3288.5740000000224 │ 3921.8910000000033 │ 200    │
│ 27      │ 'http://localhost:3080/api/tags'                                                                                │ 3288.792000000016  │ 3930.0540000000037 │ 200    │
│ 28      │ 'http://localhost:3080/api/share/link/16390000-0000-4000-8000-000000000001'                                     │ 3289.7490000000107 │ 4270.974999999977  │ 200    │
│ 29      │ 'http://localhost:3080/api/messages/16390000-0000-4000-8000-000000000001'                                       │ 3289.960999999952  │ 4422.179999999993  │ 200    │
│ 30      │ 'http://localhost:3080/api/files/config'                                                                        │ 3290.1599999999744 │ 4180.710000000021  │ 200    │
│ 31      │ 'http://localhost:3080/api/user/settings/favorites/tools'                                                       │ 3291.116000000038  │ 4437.776000000013  │ 200    │
│ 32      │ 'http://localhost:3080/api/endpoints/token-config'                                                              │ 3292.5160000000033 │ 4437.594000000041  │ 200    │
│ 33      │ 'http://localhost:3080/api/user/settings/skills/active'                                                         │ 3292.707999999984  │ 4780.808000000019  │ 200    │
│ 34      │ 'http://localhost:3080/api/agents/tools/web_search/auth'                                                        │ 3292.8979999999865 │ 7285.94299999997   │ 200    │
│ 35      │ 'http://localhost:3080/api/agents/tools/calls?conversationId=16390000-0000-4000-8000-000000000001'              │ 3293.8519999999553 │ 4781.008000000031  │ 200    │
│ 36      │ 'http://localhost:3080/api/agents/chat/status/16390000-0000-4000-8000-000000000001?generationProtocolVersion=2' │ 4533.960000000021  │ 4788.614999999991  │ 200    │
└─────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────────┴────────────────────┴────────┘

Inspect .lighthouse HTML/JSON and e2e/lighthouse/README.md. Reuse loaded user/config data; overlap independent reads without bypassing authorization.

┌─────────┬────────────────────────────┬──────────────────────┬───────┐
│ (index) │ audit                      │ median               │ limit │
├─────────┼────────────────────────────┼──────────────────────┼───────┤
│ 0       │ 'largest-contentful-paint' │ 4566.946             │ 4500  │
│ 1       │ 'cumulative-layout-shift'  │ 0.017913074727110876 │ 0.1   │
│ 2       │ 'total-blocking-time'      │ 305.92199999999957   │ 500   │
└─────────┴────────────────────────────┴──────────────────────┴───────┘

  1) [chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets 

    Error: Median largest-contentful-paint must stay within 4500

    expect(received).toBeLessThanOrEqual(expected)

    Expected: <= 4500
    Received:    4566.946

       at audit.ts:159

      157 |   console.table(measured);
      158 |   for (const { audit, median, limit } of measured) {
    > 159 |     expect(median, `Median ${audit} must stay within ${limit}`).toBeLessThanOrEqual(limit);
          |                                                                 ^
      160 |   }
      161 |   return results;
      162 | }
        at auditPage (/home/runner/work/LibreChat/LibreChat/e2e/lighthouse/audit.ts:159:65)
        at /home/runner/work/LibreChat/LibreChat/e2e/lighthouse/load.spec.ts:33:19

    attachment #1: screenshot (image/png) ──────────────────────────────────────────────────────────
    e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/test-failed-1.png
    ────────────────────────────────────────────────────────────────────────────────────────────────

    Error Context: e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/error-context.md

    attachment #3: trace (application/zip) ─────────────────────────────────────────────────────────
    e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/trace.zip
    Usage:

        npx playwright show-trace e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/trace.zip

    ────────────────────────────────────────────────────────────────────────────────────────────────


🤖: global teardown has been started
2026-09-29 15:53:08 �[32minfo�[39m: �[32mMongo Connection options�[39m
2026-09-29 15:53:08 �[32minfo�[39m: �[32m{�[39m
�[32m  "bufferCommands": false�[39m
�[32m}�[39m
🤖:  ✅  Connected to Database
🤖:  ✅  Found user in Database
🤖:  ✅  Deleted 1 convos & 2 messages
🤖:  ✅  Deleted user from Database
🤖: global teardown has been started
2026-09-29 15:53:09 �[32minfo�[39m: �[32mMongo Connection options�[39m
2026-09-29 15:53:09 �[32minfo�[39m: �[32m{�[39m
�[32m  "bufferCommands": false�[39m
�[32m}�[39m
🤖:  ✅  Connected to Database
🤖:  ⚠️  User not found in Database
  1 failed
    [chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets 

Open the full run

@berry-13
berry-13 merged commit 75bb189 into canary Sep 29, 2026
43 of 44 checks passed
@berry-13
berry-13 deleted the berry-13/fix-scrim-token-ownership branch September 29, 2026 16:18
jeannotdamoiseaux pushed a commit to jeannotdamoiseaux/LibreChat that referenced this pull request Oct 1, 2026
The stylesheet-ownership check added in LibreChat-AI#16480 required every declared
color token to be a theme key of its own, so the scrim tokens from LibreChat-AI#16492,
which compose the surface-overlay role with a scrim opacity role, failed it
once both landed on canary. A token is now owned when a variable its value
reads is one a theme can set.

(cherry picked from commit 75bb189)

Original-PR: LibreChat-AI#16512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant