Skip to content

fix(web/style): activity-chip hover/disabled use theme vars (dark mode)#105

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/activity-chip-dark-mode
Jun 25, 2026
Merged

fix(web/style): activity-chip hover/disabled use theme vars (dark mode)#105
github-actions[bot] merged 1 commit into
mainfrom
fix/activity-chip-dark-mode

Conversation

@SymbolStar

Copy link
Copy Markdown
Owner

Activity 顶部 4 个 chip 在 dark mode 下出现大块浅白胶囊,原因是 .activity-chip 的 hover/disabled 三个颜色写死 light 字面值不跟 theme 走。和之前 icon-rail dark active / xiaof portal 文字隐身同类坑。

Patchweb/style.css 一处:

  • hover bg: #E5E9EFvar(--surface-hover)
  • disabled bg: #F1F4F8var(--surface-2)
  • disabled fg: #A4ADB8var(--text-soft) + opacity: .7
  • base fg: var(--chip-text)(未定义)→ var(--text)

Designer 在 headless Edge dark mode 下截图自验过:浅白胶囊消失、All 蓝色选中态清晰、三个 disabled 弱化但可读。

Thread: th_19efda01978_a45ea6
Diagnosis & mock: @dora

…e fix)

Hard-coded #E5E9EF / #F1F4F8 / #A4ADB8 didn't flip under prefers-color-scheme: dark,
leaving pale-white pills on dark surface. Same class of bug as icon-rail dark active
and xiaof portal text-invisible.

- hover bg: #E5E9EF -> var(--surface-hover)
- disabled bg: #F1F4F8 -> var(--surface-2)
- disabled fg: #A4ADB8 -> var(--text-soft), + opacity .7
- base fg: var(--chip-text) (undefined) -> var(--text)
@github-actions

Copy link
Copy Markdown

🤖 bot-review (comment-only · phase 1)

Diff: 1 file changed, 3 insertions(+), 3 deletions(-) @ 062bb4c

Red-line checks:

  • ✅ A-7.5: no new 'forbidden' code in xiaof

Phase 2: auto-approve + auto-merge fire only when red-lines are clean, author is internal, and no needs-human path is touched. Block with no-auto-merge label or [no-auto-merge] in title.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Auto-approved by bot-review: red-line checks clean, internal author, no needs-human paths.

@github-actions github-actions Bot enabled auto-merge (squash) June 25, 2026 07:24
@github-actions github-actions Bot merged commit 9530448 into main Jun 25, 2026
7 checks passed
SymbolStar added a commit that referenced this pull request Jun 25, 2026
* feat: interrupt router dispatch via ✖ on thinking chips

Adds a stable, observable mechanism to cancel an in-flight agent turn:

- New STATUS_PHASES value 'cancelled'; chips can transition from
  thinking|running → cancelled via the new endpoint.
- POST /api/threads/<tid>/posts/<chip_id>/cancel
  * idempotent (already-cancelled → 200; terminal phases → 409 already_completed)
  * patches chip phase to 'cancelled'
  * marks chip in post_router._cancelled_chips so a late agent reply
    is silently dropped at the router boundary (router is single
    source of truth for what lands in the thread)
  * best-effort SIGTERMs the bound subprocess group for both native
    openclaw agent and ACP CLI employees
  * posts a __router__ audit line so the thread explains itself
- agent_runtime.cancel_chip_subprocess + acp_runtime.cancel_acp_chip_subprocess
  expose chip_id → pgid maps for the endpoint to nudge the right group.
- Worker (post_router._route_to_agent) checks is_cancelled() in two
  spots: on AgentError (so a SIGTERM-induced non-zero exit becomes
  'cancelled' instead of 'failed') and after a successful reply (late
  cancel drops the reply).
- ACP runtime switched from subprocess.run → Popen+communicate so the
  cancel path can SIGTERM the pgid; old timeout/failure semantics preserved.

UI (per @designer spec):
- ✖ button on thinking/running chips. Default opacity .45, hover full
  opacity + --danger color, 28×28 hit area (visual 16×16 with transparent
  padding), no confirm dialog. Touch (hover:none) keeps opacity 1.
- 'cancelled' phase renders as a low-key ⛔ pill, --text-soft only.
- Optimistic UI: click flips chip to 'cancelled' instantly with a brief
  strike-through animation; SSE/refresh reconciles. 409 path rolls back.
- All colors via CSS tokens (--danger / --text-soft); no hex (PR #105
  activity-chip lesson).

Tests:
- 3 new tests in tests/test_status_chip.py covering the happy path,
  idempotency, and terminal-phase rejection.
- tests/test_acp_runtime.py updated to fake Popen instead of run.

* fix(web): dark-mode polish on cancel chip per designer review

Two fixes from blind read-through (light OK, dark weak):

1. asc-cancelling strike-through invisible in dark.
   Old: text-decoration: line-through; opacity: .7 on already --text-soft
   text — the strike was lighter than the text. Lost the 'click landed'
   feedback that the optimistic 0ms morph depends on.
   New: animation pulls .asc-phase color up to var(--text) + 2px
   strike-thickness for ~600ms, then eases back to --text-soft so the
   final cancelled pill still rests at low-key gravity.

2. asc-cancel:hover background looked 'swallowed' in dark.
   Old: --danger-soft (#3A1818) is too close to the deep bg; the red
   circle had hue but no punch.
   New: --danger-soft-strong token (rgba(.., .22) in dark, .16 in light)
   used only by the hover circle. Light/dark each get their own value
   so the red 'lifts' off the surface uniformly.

Both fixes go through tokens — zero hex literals in component CSS.

---------

Co-authored-by: Judy <judy@symbolstar.local>
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