Skip to content

fix: theme sidechain UI with DSH web design tokens (dark mode) - #6

Merged
Buyi-wsgzg merged 2 commits into
omdsh-dev:masterfrom
Saafo:fix/dark-mode
Aug 26, 2026
Merged

fix: theme sidechain UI with DSH web design tokens (dark mode)#6
Buyi-wsgzg merged 2 commits into
omdsh-dev:masterfrom
Saafo:fix/dark-mode

Conversation

@Saafo

@Saafo Saafo commented Aug 25, 2026

Copy link
Copy Markdown

Fixes the sidechain panel and the /side / /btw command cards staying all-white in dark mode.

Root cause

The plugin's UI used a --ds-color-* variable family (--ds-color-bg-1, --ds-color-text-1, --ds-color-primary, …) that DSH web never defines. Every var() therefore resolved to its light literal fallback (#ffffff, #1d2129, #3370ff, …), so switching the app to dark mode simply had no effect on the plugin (verified by grepping the running shell's CSS/JS: --ds-color appears 0 times).

DSH web themes through design tokens injected by the host's @deepseek-ai/dsh-client-ui-theme plugin:

  • --dsw-alias-*, --dsw-specific-*, --dsw-static-* are declared on body
  • dark values override them under body[data-ds-dark-theme]

Consuming these tokens makes the panel follow the active theme (including manual theme switching) with no theme JS of our own.

Changes

  • src/client/SidechainPanel.tsx — remap the shared palette to DSW tokens
  • src/client/SideCommandCard.tsx — same for the /side / /btw cards and inline bubbles
  • src/client/panel-style.ts — running-row shimmer now uses --dsw-static-deepseek-500 / --dsw-static-deepseek-200, the same colors as the host's deep-diving hint gradient

Selected mappings (light → dark):

usage token light dark
panel / card background --dsw-alias-bg-layer-1 #fff #232324
primary text --dsw-alias-label-primary #0f1115 #f9fafb
user bubble --dsw-alias-bg-module-platform #f5f6f7 #353638
assistant bubble --dsw-specific-bubble (same as main-chat user bubble) #edf3fe #2c2c2e
code / argument blocks --dsw-alias-markdown-code-block #f9fafb #1b1b1c
composer input --dsw-specific-input-major (same as main composer) #fff #2c2c2e
badge & send button --dsw-alias-button-info-fill (host's in-chat primary action) #4176e6 #679efe
waiting hint --dsw-alias-state-business-primary #4176e6 #679efe

Every token keeps a light-mode literal fallback, so hosts that do not inject the token stylesheet still render the previous light appearance.

Verification

  • pnpm check — typecheck, 116 tests, build — all green
  • Light/dark renders of the panel against the real, running shell's token stylesheet (both themes verified)
  • Every token used in the new bundle confirmed to exist in the host theme stylesheet's body and body[data-ds-dark-theme] blocks

黄浩庭 and others added 2 commits August 25, 2026 19:56
The sidechain panel and the /side, /btw command cards referenced
`--ds-color-*` CSS variables that DSH web never defines, so every var()
fell back to its light literal — the panel stayed all-white in dark mode.

DSH web themes through design tokens injected by the host's
@deepseek-ai/dsh-client-ui-theme plugin: `--dsw-alias-*` /
`--dsw-specific-*` / `--dsw-static-*` are declared on `body` and
overridden under `body[data-ds-dark-theme]`, so consuming them follows
the active theme (including manual theme switching) without theme JS of
our own.

Remap the panel palette and command cards to those tokens, keeping a
light literal fallback for hosts that do not inject the token stylesheet,
and align the running-row shimmer with the host's deep-diving gradient.

Verified with pnpm check (typecheck, 116 tests, build) plus light/dark
renders of the panel against the real token stylesheet.
# Conflicts:
#	src/client/SideCommandCard.tsx
@Buyi-wsgzg
Buyi-wsgzg merged commit fb3568f into omdsh-dev:master Aug 26, 2026
@Buyi-wsgzg

Copy link
Copy Markdown
Collaborator

感谢提交这个修复!主题 token 的调整已经合并,现在侧链面板和命令卡片可以正确跟随 DSH 的明暗主题。

@Saafo
Saafo deleted the fix/dark-mode branch August 26, 2026 03:22
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.

2 participants