LibreChat/client/index.html
Marco Beretta 8144574b43
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
♿ feat: High Contrast Light and Dark Appearance Modes (#15178)
* refactor: read status fill labels from the theme token

Feature call sites paint the label on bg-surface-destructive,
bg-surface-submit and the bg-status-*-strong fills with the raw
text-white utility, while the shared Button, IconButton and Toast
primitives already use text-text-on-status. The token exists so the
label colour can differ per theme mode, and hard-coding white pins it.

Point every call site at text-text-on-status, and compose
DeleteIconButton onto the Button destructive variant rather than
re-declaring the fill classes. Five call sites paired a status fill with
the wrong token entirely (text-text-secondary, text-text-inverted) or
used the non-strong hue as a solid fill; those move to the -strong fill
with the on-status label. Tooltip.css and the app stylesheet copy of the
same rule read colour from --text-primary instead of literal black and
white, and the dead outline: var(--bg-surface-hover) in Dropdown.css
becomes a real 2px token outline, since that variable is not declared
anywhere and the focus ring never rendered.

--text-on-status is 255 255 255 in both shipped themes, so this is a
no-op for the light and dark palettes.

* feat: add high contrast light and dark appearance modes

Adds two appearance modes to the theme setting for users who need more
than the standard palettes, plus contrast resolution for the system mode.

The palettes are complete IThemeRGB maps rather than partial overrides,
because a token left to fall back to defaultTheme or darkTheme would
reintroduce a mid-grey the mode exists to eliminate. They resolve as a
built-in ThemeDefinition that outranks a deployment's custom theme, since
a contrast choice is an accessibility need rather than a branding
preference.

Text clears WCAG AAA on every surface it can render on, including the
hover and active fills. Borders, rings and series marks clear the 3:1
non-text floor. Solid fills clear AAA against both their label and the
page, which is what the per-mode text-on-status token buys: each mode
paints its fills on the far side of its own canvas, dark fills under a
white label on white and bright fills under a black label on black, so
the two ratios coincide instead of pulling apart.

The system mode now follows prefers-contrast the same way it already
follows prefers-color-scheme, so a user who has switched on Increase
contrast or Contrast themes gets the accessible palette without first
finding this setting. isDark reports high-contrast-dark as dark;
isHighContrast answers what the user picked, which is what the theme
toggle preserves when it flips the scheme; resolvesToHighContrast answers
whether the palette applies.

The icon toggle keeps a contrast choice when it flips the scheme, and
announces which of the four states it landed in.

* feat: cover the non-tokenized chrome in high contrast

The token layer reaches every IThemeRGB surface, but a good deal of the
stylesheet predates it and holds literals the palette cannot move. Under
html.high-contrast:

The typography variable block is 32 hard-coded hex values, and message
content carries prose dark:prose-invert, so the invert half is what dark
mode reads. Both halves now resolve from tokens: prose links were 3.77:1
on a black canvas and 5.40:1 on a white one, and every rule and border in
the set sat below the 3:1 non-text floor in one mode or the other.

The highlight.js palette is raw hex and tops out at AA, worst cases
4.84:1 for dark attributes and 5.32:1 for the alpha-blended dark comment;
these reuse the palette's own hues at AAA on each canvas.

Focus perimeters go to 3px and read the ink token rather than literal
black and white. Selection was left to UA system colours and is now an
explicit inversion. Ring opacity is pinned at full strength for the
controls that halve their own. Popover and tooltip elevation trades a
black shadow, which separates against nothing on a black surface, for a
token border. Prose links carry an underline so they are not distinguished
by colour alone. The switch track, the scrollbar thumb and track, the
markdown structure borders and the body background that .dark pins to
#212121 all move onto tokens.

* feat: draw panel and dialog edges in high contrast

Adds a high-contrast: Tailwind variant to the shared preset, so styling
can be scoped to the contrast modes the way dark: is scoped to the dark
class. Deliberately not named contrast-more, which Tailwind already ships
as the raw prefers-contrast media query: this follows the resolved app
mode, so it covers an explicit choice as well as the OS preference.

Two surfaces rely on a colour step that high contrast removes. The
sidebar's right edge is a resize separator that is transparent until
hovered, which is fine where surface-primary-alt carries the boundary but
leaves no edge at all when both sides are the same pure white or black.
Dialogs are borderless and lean on a black shadow, which separates
against nothing on a black canvas.

Both now draw a real edge in the contrast modes only. The dialog change
sits in the Radix content primitives and the two shared templates so the
feature dialogs inherit it, plus the settings panel, which is Headless UI
and bypasses them. OGDialogTemplate carries border-none, so the variant
restores the border style as well as the width.

* fix: address PR review bot findings

chatgpt-codex-connector:

Move the syntax palette into semantic theme tokens. The highlight.js
colours were raw hex in style.css, so a palette change had to be made
twice and neither copy was covered by the registry's completeness check
or any contrast test. They are eight rgb-syntax-* tokens now, declared
across all four theme maps and consumed as CSS variables, which lets the
whole high-contrast block for highlight.js go away. Two guardrails come
with them: the contrast modes assert AAA for every syntax role on the
code surface, and the stylesheet is pinned to the runtime themes with no
hard-coded hex allowed in an .hljs rule.

Two values could not be carried over literally: the dark comment and meta
colours were alpha-blended whites, so they are stored as the flattened
equivalents over the #212121 code surface. Everything else, including the
dark code text, renders byte-identical to before.

Declare Tailwind as a preset dependency. The preset ships as a raw file
through the ./tailwind-preset export while tailwindcss is only a
devDependency, so require('tailwindcss/plugin') could fail to resolve for
a consumer under pnpm or Yarn PnP. Dropped the require instead of adding
a peer dependency, since Tailwind accepts a plain function in plugins and
the wrapper only adds option handling this variant does not use.

Route remaining solid controls through semantic status roles. The
assistant builder kept bg-red-600/bg-red-700 and bg-green-500 with
text-white, which the built-in palette cannot reach, leaving them below
the mode's contract at roughly 2.28:1 for the green controls. All five
now use the destructive and submit surfaces with the on-status label, and
the two that also suppressed their focus ring get a semantic one.

* fix: address second round of PR review bot findings

chatgpt-codex-connector:

Migrate the builder submit to semantic status colors. AssistantPanel's
submit button kept btn-primary, which hardcodes #10a37f and white in
style.css, alongside a raw green hover and focus border. It uses the
submit surface with the on-status label now, and drops btn-primary rather
than fighting its specificity. Left .btn-primary itself alone: restyling
every primary button in the app is not this PR's business.

Give provider avatars contrast-safe brand colors. The white glyph sat at
2.30:1 on OpenAI green, 2.45:1 on Anthropic tan and 3.41:1 on GPT-4
purple. brands was a single theme-wide set, and a brand fill has to carry
a glyph and stand out from the canvas, both of which flip between modes,
so one set cannot serve both at enhanced contrast. ThemeModeDefinition
takes an optional brands block now, resolved after the theme-wide set, and
high contrast declares dark tints under a white glyph for light and bright
tints under a black glyph for dark. Worst pair is 8.76:1 for both the
glyph and the silhouette, with provider hues still recognisable. Brand
validation is shared between the two levels rather than duplicated.

Raise active-surface contrast against the canvas. The active fills sat at
1.48:1 and 1.98:1 on white, 1.93:1 and 2.91:1 on black, and since every
ink token collapses to one colour here, dozens of call sites were left
conveying the selected state with a sub-3:1 fill alone. The fills now
clear 1.4.11 at 3.14:1 to 4.29:1.

That costs the AAA label on those two fills, and the trade is unavoidable:
above the luminance where a fill clears the 3:1 state floor, its own label
cannot reach 7:1, and below it the state disappears. No integer grey
satisfies both. 1.4.11 is Level AA and 1.4.6 is Level AAA, so the state
wins and the labels land at 4.89:1 to 6.69:1. The spec now separates
canvas and hover surfaces, which keep AAA, from the active fills, which
assert the state floor and an AA label.

* fix: address third round of PR review bot findings

chatgpt-codex-connector:

Drop the overriding btn-primary class from Select. My previous round
assumed Tailwind utilities would win here by source order; they do not.
In the built stylesheet .btn-primary sits at byte 136886 and
.bg-surface-submit at 69233, equal specificity, so the hardcoded green won
and that button had never followed the palette. Removed btn-primary, the
same way as the submit button beside it.

Preserve contrast mode when theming Mermaid output. isDark collapses a
contrast mode onto the same boolean, so the cache key was unchanged across
light to high-contrast light and an already-rendered diagram survived the
switch untouched. Both diagram paths take the resolved contrast now: the
cache key gains a suffix, and the config carries themeVariables built from
the contrast palette, since Mermaid's own neutral and dark themes hold a
palette no theme token can reach. Diagrams render on the canvas with ink
nodes, ink edges and ink labels, which is 21:1 for every mark and label.

Artifact diagrams go through the same helper: getMermaidFiles takes the
flag, switches the generated document to Mermaid's base theme, which is
the only built-in that honours themeVariables, and paints the page with
the contrast canvas instead of the fixed #212121 or #FFFFFF. The helper
returns undefined outside the contrast modes, so standard themes keep
their current rendering exactly.

* fix: publish resolved contrast through theme context

chatgpt-codex-connector: notify consumers when system contrast changes.

Under `system` the contrast comes from a media query, so `theme` stays
`system` when the OS preference flips and React has nothing to rerender
on. The listener I added last round only touched the root element, which
is enough for CSS but not for anything computing from the resolved value:
the Mermaid cache key and the artifact files would have kept the old
palette while the rest of the app switched.

ThemeContext exposes `highContrast` now, held as state and set wherever
the mode is applied, which covers both an explicit choice and a media
change. `useMermaid` and `useArtifactProps` read it from context instead
of deriving it locally. `resolvesToHighContrast` stays exported as the
predicate the provider itself resolves with.

The existing media-change test now also asserts the context value moves,
not just the class on the root, since the DOM assertion alone passed
before this fix.

* fix: publish the resolved scheme through theme context too

chatgpt-codex-connector: publish resolved scheme changes through context.

Same staleness as the contrast case, one field over. With the mode at
`system` and contrast already on, an OS colour-scheme change reapplied the
DOM palette but `setHighContrast(true)` was a no-op and `theme` stayed
`system`, so no consumer rerendered and the diagram hooks kept the
previous `isDark` result. This half predates the PR: those hooks derived
the scheme from `theme` before it too, so a scheme flip under `system` has
never reached them.

ThemeContext exposes `resolvedMode` alongside `highContrast`, both set
wherever the mode is applied. The two diagram hooks read the scheme from
context instead of calling isDark themselves.

The other isDark call sites are left alone: none of them cache, so they
recompute whenever something else rerenders them, and sweeping every
consumer onto the context value is a wider change than this PR should
carry.

* fix: address sixth round of PR review bot findings

chatgpt-codex-connector:

Restore a visible focus cue for dropdown options. `.select-item` blanks
its own outline with `outline: none !important`, so the contrast focus
rule never landed and the navigated option was marked only by a
surface-hover fill at 1.48:1 on white and 1.93:1 on black. Hover stays
deliberately soft in these palettes, since it is transient and can afford
an AAA label, so the cue has to be a perimeter: a 3px inset outline on
the active and focused option, matching the !important it has to beat.
Verified with real keyboard navigation that the outline resolves to the
ink colour in both modes.

Apply contrast tokens to artifact controls. getMermaidFiles took the
contrast flag last round but still built its controls from the standard
palettes, whose fixed greys leave the zoom label below AAA and whose
10%-alpha border and divider sit below the 3:1 non-text floor against a
pure canvas. The controls now come from the same tokens as the diagram:
canvas fill, ink border and label, the active surface for hover, and no
shadow, since a black shadow separates against nothing there.

* fix: ignore undefined brand overrides when resolving a theme

chatgpt-codex-connector: ignore undefined mode brand overrides.

Partial<IThemeBrands> lets a key be present with undefined, and the brand
validator accepts it, so spreading a mode block over the inherited set
could overwrite a brand with nothing. Colors survive this because
mapColors skips undefined, but every brand token is written to the DOM
unconditionally, so the avatar would have lost its fill instead of falling
back the way a partial theme promises.

Both spreads now drop undefined entries, which covers the theme-wide set
as well as the mode block, and keeps ResolvedThemeDefinition.brands honest
about being fully populated.

* fix: address eighth round of PR review bot findings

chatgpt-codex-connector:

Guard media queries during server rendering. The state initializers I
added read prefers-color-scheme and prefers-contrast synchronously during
render, so a server-rendered provider threw before producing markup. That
was a regression: nothing in the provider read a media query during render
before. Both reads go through a helper that returns false without a
window, the way the storage helpers already tolerate its absence, so the
server renders the light palette with no contrast override and hydration
applies the real values. The subscription effect is guarded too, which
also covers a host that has no matchMedia at all.

Keep Mermaid pie slices distinct in contrast mode. My own regression: the
contrast variables set primaryColor, secondaryColor and tertiaryColor to
the canvas, and mermaid derives pie1 through pie3 from those, so every
slice collapsed into the background and into its neighbours. The pie slots
come from the palette's series ramp now, which is the categorical scale
already built to clear the mark floor on that canvas and stay separable
under simulated deuteranopia. Twelve slots wrap over seven, as mermaid's
own palettes do.

Remove the raw white override from bookmark submit. The save button passed
text-white into the shared submit variant, which tailwind-merge resolved
in favour of the local class, leaving white on the bright submit fill at
1.40:1. Dropped the override so the variant's token applies.

Preserve the high-contrast canvas in screenshot exports. The export chose
between two fixed colours, so a contrast export was filled with #171717
instead of the mode's canvas. It reads the resolved canvas token now, with
the old pair as the fallback.

Theme markdown artifact previews in contrast modes. useArtifactProps
forwarded the appearance only to the mermaid branch. getMarkdownFiles
takes it now and appends a contrast block derived from the palette; being
unconditional it also outranks the sheet's own prefers-color-scheme query,
so an explicit contrast choice is honoured whatever the OS reports.

* fix: migrate agent version controls to semantic status roles

chatgpt-codex-connector: migrate agent-version controls to semantic status
roles.

The active-version marker and the Restore action used raw green fills with
text-white, about 2.28:1 and 3.30:1, and the built-in palette cannot reach
either. The marker takes the strong success fill with the on-status label,
and Restore takes the submit surface, matching the assistant builder
migration.

Also finished the rest of that component's active-version treatment rather
than leaving it half migrated: the card border and tint, the title, and
the Current chip now use the success subtle, border and strong roles. The
same indicator was expressing one state through both raw and semantic
colour otherwise.

ToolCard's native badge and selected tick were the same shape, raw emerald
under white, so they move to the strong success fill too.

Left alone: the HTTP method badges in ActionsTable/Columns.tsx, the
tool-kind colours in items/icons.ts, and CategoryFilter's active border.
Those are categorical identity rather than status, so mapping them onto
status roles would be wrong; they need the treatment provider brands got,
which is its own change.

* fix: address tenth round of PR review bot findings

chatgpt-codex-connector:

Use opposing ink for pie-section labels. My own regression from the slice
fix: the series ramp deliberately sits on the far side of the canvas so
slices are visible, which makes the canvas ink the wrong colour for a
label drawn inside one. Section labels take the on-status ink now, the
same colour the palette uses for a label on any solid fill, while the
title and legend keep the canvas ink because they are drawn on the canvas.

Preserve the blue initializing status in standard themes. Also mine, from
the first round: I moved this dot to bg-status-info-strong, and the strong
info slot is a neutral grey in both standard palettes, so a blue
indicator turned grey. Back on bg-status-info, with the pulse taking the
on-status ink so it inverts with the fill rather than being a fixed white.

Route action method badges through contrast tokens. I declined this last
round as categorical identity rather than status; the reviewer's framing
is better. The series ramp is precisely the home for categorical identity,
it is contrast-checked per mode, and its slots are separable under
simulated deuteranopia, so the verbs map onto it while staying close to
their conventional colours. `delete` keeps a red by taking the error role,
since destructive genuinely is a status.

* fix: seed published theme values without reading a media query

chatgpt-codex-connector: defer media-query resolution until after
hydration.

Guarding window stopped the crash but left the server and the first client
render disagreeing: the server produced light and false while the client
resolved the OS preferences during that same first render, so any child
reading the published values hydrated against different context.

Both are seeded from the mode string alone now. An explicit mode needs no
query, so it publishes immediately and stays consistent with isDark; only
system starts at the light palette with no contrast override, on both
sides, and applyThemeMode publishes the resolved values from its effect
after hydration.

The pre-existing localStorage read in getInitialTheme has the same shape
of problem for `theme` itself, but changing where the stored mode is read
is a wider change than this and belongs on its own.

* fix: address eleventh round of PR review bot findings

chatgpt-codex-connector:
- keep the active version timeline rail opaque so it clears the 3:1 mark
  floor in both high contrast modes instead of compositing to ~2:1
- balance the dark success fill (#088759) so the selected-tool marker,
  the timeline rail and the prompt-version chip keep a visible silhouette
  on the #212121 panel while the white label stays at WCAG AA
- include the resolved scheme and contrast in the mermaid cache key even
  when a custom theme is supplied, so a contrast switch re-renders

* fix: address twelfth round of PR review bot findings

chatgpt-codex-connector:
- select mermaid's base theme ahead of a caller-supplied theme in the
  contrast modes, after the config spread, so the contrast variables
  actually reach the diagram
- ship the tooltip and popover contrast edges in the package stylesheets
  they belong to, so a consumer importing @librechat/client gets them

* chore: sort imports in the theme registry, provider and specs

* fix: override the markdown preview table header in contrast modes

The appended contrast block answered the ink, the canvas and the cell
borders but not the thead tint, so an explicit contrast choice on the
opposite OS scheme left white text on #f6f8fa or black text on #161b22.
The header now takes the palette canvas and reads through its bold cells
and border, and a new guardrail asserts every colour the base sheet sets
inside prefers-color-scheme is answered by the override.

* fix: address thirteenth round of PR review bot findings

chatgpt-codex-connector:
- keep an OS-requested contrast when the scheme toggle runs under the
  system mode, by reading the resolved contrast rather than the stored
  appearance name
- move the unchecked switch track into the theme token registry so the
  shared Switch keeps its track for consumers of @librechat/client, and
  drop the SPA-only high-contrast overrides it no longer needs

* fix: address fourteenth round of PR review bot findings

chatgpt-codex-connector:
- migrate agent and assistant validation states off raw red utilities and
  onto the destructive text and border roles, so the messages, the field
  outlines and the required markers follow the contrast palettes
- theme the file-source badges with series slots and the status label ink
  instead of fixed blue and yellow fills behind an alpha

* fix: paint the loading canvas from the resolved appearance

The bootstrap in index.html read the stored mode's scheme but not the OS
contrast, so system plus prefers-contrast: more flashed the standard-dark
#0d0d0d behind the pure-black palette for the whole application load. An
unset mode also painted white on a dark OS, though getInitialTheme
resolves it as system. Both branches now resolve the same way the theme
provider does, and a new spec runs the shipped script to prove it.

* fix: theme the markdown renderer failure message

The notice painted when the marked CDN does not load carried an inline
color:#e53e3e, the one colour the appended contrast block could not
reach, leaving it at 4.13:1 on the high-contrast light canvas. It is a
.markdown-error rule now, which the base sheet declares with the current
red and the contrast block overrides with the palette's destructive ink.

* fix: address PR review bot findings

chatgpt-codex-connector:

- Route shortcut, steer, warning, and help-link states through semantic theme roles.
- Add contrast-safe Mermaid Gantt variables for task, status, section, grid, and label states.
- Theme Mermaid artifact render failures with destructive text colors.
- Apply native color-scheme behavior through ThemeProvider and restore host values.

* fix: address follow-up PR review findings

chatgpt-codex-connector:

- Route conflicting shortcuts through the semantic warning border.
- Give checked composer capabilities opaque semantic series borders.
- Move search results and their fade onto the presentation token.
- Restore a visible semantic focus ring on the virtualized results list.

* fix: address third-round review findings

* fix: address fourth-round review findings

* fix: align accessibility theme after dev rebase

* fix: address PR review bot findings

chatgpt-codex-connector:
- Route the steer and queue identities through semantic `status-warning` /
  `status-info` roles in `Chat/Steering/identity.ts`, so the receipt label,
  its pulse dot and every Zap/Clock mark move with the theme instead of
  staying pinned to amber-500/600 and cyan-500. Fixes the high-contrast
  light failures (3.19:1 label text, 1.97:1 and 2.43:1 marks) and the
  default light label, which was also below the 4.5:1 text floor.
- Pair each Monaco theme with the canvas it paints in `ArtifactCodeEditor`,
  so the transparent `@monaco-editor/react` loading view no longer flashes
  the light `surface-code` fill before the `vs-dark` editor mounts outside
  high contrast.

* fix: declare the new dev theme tokens in the high contrast palettes

dev added rgb-text-muted and the two chart widget tokens after this branch
last rebased. The high contrast palettes did not name them, so the widget
canvas and muted text fell back to the standard themes' greys, which the
palette coverage spec caught. Both modes now take the plain canvas, pure
ink and a pure-ink edge, and the contrast tables cover the new tokens.

* style: sort imports in the specs this branch touched

The added imports put ArtifactCodeEditor, ShortcutRecorder and OptionToggle
out of the repo's import order, which the static-checks import-sort gate
rejected.

* fix: address fifth-round review findings

chatgpt-codex-connector:
- Preserve the pressed treatment on a disabled OptionToggle, so a tool made
  programmatic-only keeps showing the Intent state aria-pressed still reports.
- Expose high contrast from the auth appearance control: the scheme toggle
  preserves contrast but never introduces it, so a logged-out user had no way
  to reach the palette. Adds a contrast toggle beside it, and the scheme toggle
  now shows the scheme rather than duplicating the contrast glyph.
- Resolve system contrast from prefers-contrast: custom and forced-colors:
  active as well as more, since a Windows Contrast Theme never reports more.
  Mirrored in the index.html loading bootstrap and the theme README.
- Route the remaining raw palette utilities through theme roles: agent success
  checks (Action, AdvancedPanel, ToolSection) to status-success, the favorited
  tool star to series-4, the orchestration Beta pill to brand-purple, the
  temporary-composer accent to series-6, and the pending quote marks to
  status-info.
- Override the legacy btn-neutral chrome in the contrast block, whose
  hard-coded edge and hover fill sat at 1.1:1 and 2.09:1 on the new canvases.

Rebased onto dev.

* fix: mark the selected tab and theme placeholder ink in contrast modes

Two states rendered invisibly under the high contrast palettes, both verified
in a browser before and after:

- Radix tab triggers mark selection with `surface-tertiary`, which is the plain
  canvas here, so the selected Settings section computed to the same
  rgb(0 0 0) fill as every unselected sibling. Give it the same inset perimeter
  `.select-item` already uses for its navigated option.
- Tailwind preflight paints `::placeholder` with the raw gray-400 #999696, and
  a field that omits a `placeholder:` utility inherits it: the Custom
  Instructions textarea measured 4.06:1 on the black canvas and 3.08:1 on the
  white one, both under the 1.4.3 floor for what is ordinary text. Route it
  through `text-secondary`, which is pure ink in both palettes.

* fix: mark selection with a perimeter and lighten the contrast selected fills

The selected fill was carrying WCAG 1.4.11 on its own, which forced it dark
enough (#8c8c8c light, #5c5c5c dark) that its own label capped at 6.25:1 and
6.69:1 — under the AAA these modes exist for, and visibly heavy on the light
canvas. The `.select-item` rule already showed the better answer: mark the
state with a `text-primary` perimeter at 21:1 and let the fill stay light.

Generalise that rule to the two families it missed — every other Ariakit menu,
whose navigated row carried only a `surface-hover` fill at 1.48:1 on white, and
any row painted with the selected-surface role — then lighten the fills behind
it: #e3e3e3 / #d4d4d4 light and #2b2b2b / #3d3d3d dark, all four AAA under
their label. `-alt` meets `surface-hover`, as it does in the standard palettes.
Inline `span` is excluded so a highlighted citation passage is not boxed per
wrapped fragment.

The palette contract moves with it: `activeFills` is now held to an AAA label
rather than to 3:1 against the canvas, which the perimeter discharges.

* fix: address sixth-round review findings

chatgpt-codex-connector:
- Ship the selected-state contrast with the package. The lightened
  `surface-active` fills only work because a perimeter marks the selection, and
  that perimeter lived in the SPA stylesheet, which `tsdown` never publishes —
  so `TimePicker`, `SelectDropDown`, `MultiSelect`, `InputWithDropDown`, `Badge`
  and `DataTable` gave an external consumer a 1.28:1 fill and nothing else. The
  perimeters and the placeholder ink now live in
  `packages/client/src/theme/highContrast.css`, imported by `ThemeProvider`;
  `style.css` keeps only what is genuinely SPA-only. The Ariakit selector also
  widened from four menu roles to `[data-active-item]`, and picked up
  `[data-state='selected']` for package data-table rows.
- Give Monaco selections a contrast-safe highlight: a focused selection now
  inverts the canvas (`text-primary` on `surface-primary`), matching
  `::selection`, because Monaco draws no perimeter. Weaker emphases share
  `surface-hover-alt` behind the ink find-match border.
- Populate Mermaid's separate `git0`-`git7` branch palette from the series ramp.
  Eight slots against a seven-slot ramp, so the last takes the ink rather than
  repeating branch one; labels take the canvas, since the ramp sits on its far
  side.
- Debounce the two appearance controls separately. They are independent
  settings, so light -> high-contrast dark is one flip of each, and the shared
  500ms window swallowed the second click.
- Route sharing principal badges (USER/GROUP/ROLE) through series-1/7/6.
- Apply the selected contrast mode to Office artifacts. The backend document
  picks its palette from `prefers-color-scheme` alone, so an explicit mode
  inverted whenever the OS disagreed. `withOfficeContrast` re-declares its
  `:root` tokens and pins `color-scheme` from inside the head.

* fix: address seventh-round review findings

chatgpt-codex-connector:
- Restore the citation highlight. The perimeter rule skips `span` so a wrapped
  passage is not boxed per fragment, which left the inline highlight on the
  lightened fill alone. It inverts now instead — the same treatment the mode
  gives `::selection`, 21:1 and with no geometry to wrap.
- Underline non-prose links. The 1.4.1 rule only reached `.markdown` and
  `.prose`, so the auth resend actions and in-dialog help links were colour-only
  against ink that is under 3:1 from them. It now also covers the shared
  `text-link` role, including the ones rendered as a `button`, and moved to the
  package stylesheet since that role is shared. MCP server descriptions style
  their anchors through an `[&_a]` variant rather than a class of their own, so
  they get the underline at the call site — running text, so it applies in every
  theme, not just the contrast ones.
- Route the selected tool card through `status-success` instead of
  `emerald-500/60` over a 6% fill, which composited to about 1.7:1 and left a
  selected card with a weaker edge than an unselected one.

* fix: keep helper hints opaque in the contrast modes

chatgpt-codex-connector: the `opacity-40` default-value hints composite pure
ink to about #999 on the white canvas (2.85:1) and #666 on the black one
(3.66:1), so small active labels missed even AA under a palette that contracts
for AAA. They take `high-contrast:opacity-100` now — the variant this branch
already added and `MessageNav` already uses — rather than a new token: every
text role is the same pure ink in these palettes, so there is no muted colour
to fall back to and the hierarchy is carried by size and the parentheses.

The mobile artifact drag handle gets the same treatment: it is a control, so
1.4.11 applies, and a 40% ink bar does not clear 3:1. The two remaining
`opacity-40` sites are left alone deliberately — `AssistantTool` dims a
disabled row, which WCAG exempts, and the `MarketplaceCatalog` empty-state
glyph is `aria-hidden` decoration.

* style: sort imports in the two parameter controls this branch touched

* fix: soften the temporary-chat accent outside the contrast modes

Moving the accent to `series-6` swapped a 60%-alpha `violet-800` edge for a
full-strength one, and series-6 is a saturated #7e23cd on the light palette and
#ab68fe on the dark one — the composer read as a warning rather than a quiet
mode hint. Half alpha in the standard palettes, opaque only under
`high-contrast:`, which is the one place the edge has to clear the 3:1
non-text floor.
2026-09-05 22:20:33 +02:00

223 lines
8 KiB
HTML

<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<base href="/" />
<meta name="theme-color" content="#171717" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta
name="description"
content="LibreChat - An open source chat application with support for multiple AI models"
/>
<title>LibreChat</title>
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon-16x16.png" />
<link rel="apple-touch-icon" href="assets/apple-touch-icon-180x180.png" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, interactive-widget=resizes-content"
/>
<style>
html,
body {
margin: 0;
padding: 0;
height: 100%;
}
</style>
<script>
const theme = localStorage.getItem('color-theme');
const loadingContainerStyle = document.createElement('style');
let backgroundColor;
if (theme === 'high-contrast-dark') {
backgroundColor = '#000000';
} else if (theme === 'high-contrast-light') {
backgroundColor = '#ffffff';
} else if (theme === 'dark') {
backgroundColor = '#0d0d0d';
} else if (theme === 'light') {
backgroundColor = '#ffffff';
} else {
/* `system`, and anything unset or unrecognised, which ThemeProvider also
* resolves as `system`. The OS decides the scheme and the contrast, and
* a contrast request moves the dark canvas to pure black, so keying off
* the scheme alone would flash #0d0d0d behind the black palette.
* The three contrast queries mirror ThemeProvider's `CONTRAST_QUERIES`:
* a Windows Contrast Theme reports `forced-colors: active` with
* `prefers-contrast: custom`, never `more`. */
const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
const prefersMoreContrast = [
'(prefers-contrast: more)',
'(prefers-contrast: custom)',
'(forced-colors: active)',
].some(function (query) {
return window.matchMedia(query).matches;
});
backgroundColor = prefersDarkScheme
? prefersMoreContrast
? '#000000'
: '#0d0d0d'
: '#ffffff';
}
loadingContainerStyle.innerHTML = `
#loading-container {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
background-color: ${backgroundColor};
}
`;
document.head.appendChild(loadingContainerStyle);
</script>
<script>
(function () {
var KEY = 'lc-asset-recovery-at';
var RUM_QUEUE_KEY = 'lc-rum-queue';
var MAX_RUM_QUEUE = 20;
window.__lcRumRecoveryGuardInstalled = true;
window.__lcRumQueue = Array.isArray(window.__lcRumQueue) ? window.__lcRumQueue : [];
try {
var persistedQueue = JSON.parse(sessionStorage.getItem(RUM_QUEUE_KEY) || '[]');
if (Array.isArray(persistedQueue)) {
window.__lcRumQueue = persistedQueue.concat(window.__lcRumQueue).slice(-MAX_RUM_QUEUE);
}
} catch (e) {
/* Diagnostics should never affect application startup. */
}
window.__lcRumPush = function (type, attributes) {
try {
var safeAttributes = {};
Object.keys(attributes || {}).forEach(function (key) {
var value = attributes[key];
if (
typeof value !== 'string' &&
typeof value !== 'number' &&
typeof value !== 'boolean'
) {
return;
}
safeAttributes[key] = value;
});
if (window.__lcRumQueue.length >= MAX_RUM_QUEUE) {
window.__lcRumQueue.shift();
}
window.__lcRumQueue.push({
type: type,
at: Math.round(performance.now()),
visibilityState: document.visibilityState,
attributes: safeAttributes,
});
sessionStorage.setItem(RUM_QUEUE_KEY, JSON.stringify(window.__lcRumQueue));
} catch (e) {
/* Diagnostics should never affect application startup. */
}
};
function shouldRecover() {
try {
var last = Number(sessionStorage.getItem(KEY)) || 0;
if (Date.now() - last < 60000) {
return false;
}
sessionStorage.setItem(KEY, String(Date.now()));
return true;
} catch (e) {
return false;
}
}
window.__lcRecoverStaleAssets = function () {
if (!shouldRecover()) {
return false;
}
window.__lcRumPush('stale-asset-recovery-start');
var reload = function () {
window.__lcRumPush('stale-asset-recovery-reload');
window.location.reload();
};
if (navigator.serviceWorker) {
var scopeBase = new URL('./', document.baseURI || window.location.href).href;
navigator.serviceWorker
.getRegistrations()
.then(function (registrations) {
return Promise.all(
registrations
.filter(function (registration) {
return registration.scope.indexOf(scopeBase) === 0;
})
.map(function (registration) {
return registration.unregister();
}),
);
})
.then(reload, reload);
} else {
reload();
}
return true;
};
if (navigator.serviceWorker) {
navigator.serviceWorker.addEventListener('message', function (event) {
if (!event.data || event.data.type !== 'LC_SW_PING') {
return;
}
var source = event.source || navigator.serviceWorker.controller;
if (source) {
source.postMessage({ type: 'LC_SW_PONG' });
}
});
}
window.addEventListener(
'error',
function (event) {
var el = event.target;
if (!el || !el.tagName) {
return;
}
var failedScript = el.tagName === 'SCRIPT' && el.src;
var failedPreload =
el.tagName === 'LINK' && /preload/.test(el.rel || '') && /\.js$/.test(el.href || '');
if (failedScript || failedPreload) {
var isRumBootstrap = el.getAttribute('data-lc-rum-bootstrap') === 'true';
window.__lcRumPush('asset-load-error', {
tagName: el.tagName,
assetUrl: el.src || el.href,
optional: isRumBootstrap,
});
if (isRumBootstrap) {
return;
}
window.__lcRecoverStaleAssets();
}
},
true,
);
window.addEventListener('unhandledrejection', function (event) {
var message = event.reason && event.reason.message;
if (
typeof message === 'string' &&
(message.indexOf('dynamically imported module') !== -1 ||
message.indexOf('Importing a module script failed') !== -1)
) {
window.__lcRumPush('dynamic-import-error');
window.__lcRecoverStaleAssets();
}
});
})();
</script>
<script
data-lc-rum-bootstrap="true"
type="module"
src="/src/lib/rum/bootstrap-entry.js"
></script>
<script defer type="module" src="/src/main.jsx"></script>
</head>
<body>
<div id="root">
<div id="loading-container"></div>
</div>
</body>
</html>