Skip to content

fix(ui): make schedule secret-request warn note readable in dark mode - #21068

Closed
tmack8001 wants to merge 1 commit into
kirodotdev:mainfrom
tmack8001:fix/schedule-warn-note-dark-contrast
Closed

tmack8001 wants to merge 1 commit into
kirodotdev:mainfrom
tmack8001:fix/schedule-warn-note-dark-contrast

Conversation

@tmack8001

@tmack8001 tmack8001 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Make the Schedule page's "Agent requested secrets" warn note readable in the default dark Kiro theme.

When a job has a pending secret-request approval, the warn note renders its text near-black on the dark warn tint: the title, the direction caption, the env ← vault list, the help paragraph and the "Script this approval covers" heading are all effectively unreadable in dark mode.

Why it matters

The secret-request note is a security-relevant approval surface — it tells the user which vault secrets a job will receive. In the default dark theme its text is dark-on-dark, so the person deciding whether to approve cannot read what they are approving without switching themes.

Not a goal

What changed (motivation → approach → change)

The note paints its text with text-warn-fg, which resolves to --warn-fg — #000 in every dark palette, meant for a saturated bg-warn fill, not for the translucent bg-warn-subtle tint over a dark surface. So the text came out black on dark.

The fix swaps text-warn-fg for text-warn-text on every bg-warn-subtle container carrying this defect. --warn-text is var(--warn) at :root (the readable warn hue) and darkens to color-mix(warn 50%, #000) only under [data-mode="light"], so dark mode now paints the warn hue and light mode keeps #20184's darkened value. This is the same utility #20184 established for warn-text-on-warn-tint across the dashboard.

The sites are six, across three files, all bg-warn-subtle + text-warn-fg, all the same defect: the Schedule page's pending-secrets note, its "writes to your repos" badge, and the job-dialog writes notice (SchedulePage.tsx); the same writes badge in the schedule template gallery (ScheduleTemplateGallery.tsx); and the auto-nudge status line and legacy-loop notice (AutoNudgePopover.tsx). Other text-warn-fg uses in the tree sit on a solid bg-warn fill, where it is correct, and are left unchanged.

Backwards compatibility

Compatible: a CSS utility-class swap on six elements across three files; no contract, prop, type or data shape changes.

Removes nothing: no path, record, key, validator or function is removed or tightened — six class strings change value.

Tests

No new automated test — the change is a painted-colour utility value that unit tests do not assert. The existing website/src/pages/SchedulePage.secrets.test.tsx (6 tests) still passes, and website/src/test/SessionAutomationPopover.test.tsx is updated in this PR: its assertion pinning the legacy-notice's old text-warn-fg now asserts text-warn-text (the intentional swap; the warn hue the test guards as the cost cue is preserved — only the token that makes it readable in dark mode changes). The before/after screenshots below are the readability evidence.

Note: the earlier revision carried a one-off Playwright capture script that only drove the local session to produce these screenshots. It was session scaffolding, not a maintained repo harness, so it has been removed; the uploaded screenshots are the deliverable.

Manual verification

Captured the before/after panes against the production build (see Screenshots). Static gates (isort, flake8, mypy --platform linux, tsc) pass, and the SchedulePage.secrets + SessionAutomationPopover vitest suites (107 tests) pass locally.

Screenshots / video

Real pane, full application chrome: the actual /schedule job dialog with the "Agent requested secrets" note, reached through the genuine flow (a real script cron carrying a real pending secret request), both themes. Secret/env names are generic placeholders (EXAMPLE_API_TOKEN / example_api_token).

Before — text-warn-fg, the note's text is near-black on the dark warn tint (dark mode):

Before (dark): secret-request note dark-on-dark in the job dialog

After — text-warn-text, readable:

After (dark): secret-request note readable in the job dialog

Light theme (keeps #20184's darkened value)

Before (light):

Before (light)

After (light):

After (light)

Related Issues

Closes #21057

Pattern harvest

Rule candidate: review-prompt
Pattern: text-warn-fg (the on-solid foreground, #000 in dark palettes) paired with a bg-warn-subtle/bg-warn/N tint instead of text-warn-text — dark-on-dark in dark mode. #20184 fixed the light-palette half for text-warn; this is the dark-mode text-warn-fg sibling.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@tmack8001
tmack8001 requested review from a team and KiroCrewCaptain as code owners October 16, 2026 03:34
@tmack8001
tmack8001 requested a review from mbriones98 October 16, 2026 03:34
@github-actions github-actions Bot added the fork Pull request from a fork (external contributor) label Oct 16, 2026
tmack8001 added a commit to tmack8001/KiroCrew that referenced this pull request Oct 16, 2026
tmack8001 added a commit to tmack8001/KiroCrew that referenced this pull request Oct 16, 2026
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Oct 16, 2026
@tmack8001
tmack8001 force-pushed the fix/schedule-warn-note-dark-contrast branch 2 times, most recently from 8482b75 to 27b67ed Compare October 16, 2026 04:03
@tmack8001

Copy link
Copy Markdown
Contributor Author

Friendly nudge for the requested reviewers: this PR is waiting on a reviewer approval to unlock the CI gates and kick off the agentic reviews. There's no outstanding author action — the labels no longer require an author decision. Could you approve to let CI run, or trigger a re-review workflow? Thanks!

@tmack8001
tmack8001 force-pushed the fix/schedule-warn-note-dark-contrast branch from 27b67ed to 4aa0056 Compare October 16, 2026 21:53
@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 4aa005662f5d52bfddc4e4ad304cc28bfb378031 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] 4aa0056

Description read

[DESCRIPTION-READ] 37df0e7b29ff991872c58868edae2b9fff8d08c90cfd02f2d1da5168c11d0c33

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — 🔴 BLOCK

UX-level review of 4aa005662f5d52bfddc4e4ad304cc28bfb378031 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: BLOCK

cannot evaluate: missing screenshots of five of the six recoloured warn surfaces; only the secrets note is shown.

Evidence gaps

  • "Writes to your repos" badge on the Schedule page template cards (SchedulePage.tsx:709). Needs a dark and a light still of a template card that writes.
  • The same badge in the template gallery (ScheduleTemplateGallery.tsx:58). Needs dark and light stills of the gallery.
  • Job-dialog writes notice, schedule-writes-notice (SchedulePage.tsx:1613). Needs a still of a new job made from a writes template.
  • Auto-nudge status line in the in-progress warn state (AutoNudgePopover.tsx:710). Needs a still of the popover with a running loop.
  • Legacy-loop notice, legacy_notice (AutoNudgePopover.tsx:743). This is the surface's only cost cue, so it needs dark and light stills.

Watch

  • The dark "before" screenshot doesn't show the defect the PR describes. The description says the text is "near-black on the dark warn tint". In attachment-01 the title, mapping, help text and "Script this approval covers" are light grey and readable. So the screenshot doesn't prove there was a dark-mode readability problem, or that this change is what fixes it. It is also unclear which theme the default dark one is (--warn-fg:#000 at index.css:705). Recapture "before" in the theme where the text is really dark, and name that theme.
  • The whole secrets note now renders in the warn hue (attachment-02). That includes the help paragraph and the EXAMPLE_API_TOKEN ← example_api_token mapping, while the caption stays muted. This affects every pending approval, but it is cosmetic, so low severity. Confirm that amber body text on the amber tint passes AA contrast at 11–13px.

[UX-REVIEWED] 4aa0056

Description read

[DESCRIPTION-READ] 159bfc2599225e0e123290ea57dcec498630b5dbb38d2e38b2c309aec3da97c9

That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — 🟡 CONCERNS

Premise-level review of 4aa005662f5d52bfddc4e4ad304cc28bfb378031 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The real cause is any on-solid -fg token painted on a -subtle tint, not just warn. The ternary this PR edits still carries bg-ok-subtle text-ok-fg, which is black-on-dark in dark mode.

Not justified as shipped

  • Item 4 — symptom-level: the fix stops at the warn hue. AutoNudgePopover.tsx:707 keeps 'border-ok/30 bg-ok-subtle text-ok-fg', two lines above the hunk at 710. Base sets --ok-fg:#000 in dark palettes, so that is the same defect. Grep bg-(ok|err|danger|info|accent)-subtle.*text-…-fg on base: 1 confirmed unfixed sibling (ProjectsPage.tsx:487 applies -fg only with solid sm:bg-accent, so it is fine). The text-ok-text utility already exists (53 hits for ok-text).
    Subtraction: replace text-ok-fg at AutoNudgePopover.tsx:707 with the existing text-ok-text, so the hunk removes the whole -subtle+-fg pairing in this component.
    Clears when: AutoNudgePopover.tsx:707 stops pairing bg-ok-subtle with text-ok-fg, or the description says the ok-hue sibling is deferred.

What this change ships

Inventory (5 items) — 4 justified

Intent: make the "Agent requested secrets" approval note, and its same-defect siblings, readable in dark mode — FIX (#21057).

  1. Schedule job-secrets pending note text readable in dark mode — justified
  2. "Writes to your repos" badge readable (Schedule page + template gallery) — justified
  3. Job-dialog writes notice readable — justified
  4. Auto-nudge status line and legacy-loop notice readable — symptom-level: adjacent ok-hue sibling left at :707
  5. Popover test pin moved from text-warn-fg to text-warn-text, same warn cue — justified

[FIRST-PRINCIPLES-REVIEWED] 4aa0056

Description read

[DESCRIPTION-READ] fb16e4785bb96c7c3ec8b29fe17da49dfd0c47b5c33907ea5e5fa24125626476

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 4aa005662f5d52bfddc4e4ad304cc28bfb378031 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 4aa0056

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 4aa005662f5d52bfddc4e4ad304cc28bfb378031 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 4aa0056

@tmack8001

Copy link
Copy Markdown
Contributor Author

Screenshots — all six recoloured warn surfaces, before vs after, both themes

Captured against the real components, stylesheet, theme tokens, lucide icons and i18n catalog (no reconstruction) via a website/capture/ fixture following the existing shoot-*.mjs convention. Each frame stacks all six surfaces the PR retones; the only variable between before and after is the one class this PR changes — text-warn-fg → text-warn-text — so the pair isolates exactly the fix.

Theme named (per the review's watch item): the default dark theme is kiro-dark, where --warn-fg resolves to near-black (#000), which is why the before text is dark-on-dark. The after token --warn-text resolves to the warn hue, readable on the tint. In kiro-light the text was already dark; after shifts it to #20184's darkened warn value (a deliberate change, not "unchanged").

Dark theme (kiro-dark) — the surface the fix is for

Before — text-warn-fg: near-black body text on the dark warn tint (the defect)

before, dark theme — all six warn surfaces with near-black text on the dark warn tint

After — text-warn-text: warn-hue body text, readable on the tint (the fix)

after, dark theme — all six warn surfaces in the readable warn hue

Light theme (kiro-light) — the control

Before — text-warn-fg

before, light theme — all six warn surfaces

After — text-warn-text (shifts to #20184's darkened warn value)

after, light theme — all six warn surfaces

Surfaces covered (the five the review flagged as missing, plus the secrets note)

# Surface Source
1 "Writes to your repos" badge — Schedule preset card SchedulePage.tsx:709
2 Same badge — template gallery ScheduleTemplateGallery.tsx:58
3 Job-dialog writes notice (schedule-writes-notice) SchedulePage.tsx:1613
4 Secrets pending note SchedulePage.tsx:1379
5 Auto-nudge status line (in-progress warn state) AutoNudgePopover.tsx:710
6 Legacy-loop notice (legacy_notice) AutoNudgePopover.tsx:743

On the "amber-on-amber contrast at 11–13px" watch item

--warn-text is the token #20184 added specifically so warn-tinted surfaces have a readable foreground; it resolves to the warn hue at full chroma in dark mode (not a muted tint-on-tint). The frames above are at deviceScaleFactor: 2 so the 11px legacy notice and 12.5px writes notice can be judged directly. This PR does not change the tint (bg-warn-subtle) or the font sizes — it only swaps the foreground token from the fill-foreground (--warn-fg) to the on-tint token (--warn-text), which is strictly more readable on the subtle tint than what shipped.

The capture fixture/driver is intentionally not committed to the PR — it was only used to generate this evidence; the diff stays the minimal six-site token swap + its coupled test.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 23, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Thanks for this fix, @tmack8001! Closing it because the change has already landed on main. #21483 (merge commit 4630066) switched the Schedule page and ScheduleTemplateGallery warn notes and badges from text-warn-fg to text-warn-text, and closed #21057. On current main, every bg-warn-subtle site this PR touches (the pending-secrets note, the writes badge and the job-dialog writes notice in SchedulePage.tsx, the gallery writes badge, and the two AutoNudgePopover notices) already uses text-warn-text. So rebasing would leave an empty diff. If you see a warn note that is still unreadable in dark mode, please open a new issue and we will take a look.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ui): secret-request warn note is dark-on-dark in dark Kiro theme

2 participants