fix(ui): correct font contrast and background colors in dark mode #84

Merged
sarman merged 2 commits from fix/dark-mode-font-contrast into master 2026-06-08 14:47:59 +00:00
Owner

Summary

  • Toggle switches — knob was bg-white (invisible against bg-muted in dark mode); changed to bg-background
  • ImageGallery — thumbnail containers, filename labels, alert banners, and modal chrome used hardcoded gray/white with dark text; full dark: variants added throughout
  • ShellExecution tier cardsTIER_CONFIG used bg-*-50 (near-white) backgrounds with dark text; replaced with dark:bg-*-950/30 and light text colors for all three tiers
  • ShellApprovalModal — tier badge was hardcoded bg-yellow-50; dark variants added
  • LogUpload PII alertbg-amber-50/text-amber-800 became unreadable on dark background; added dark:bg-amber-900/20 with lighter text

Files changed

  • src/components/PiiDiffViewer.tsx
  • src/pages/Settings/Security.tsx
  • src/components/ImageGallery.tsx
  • src/pages/Settings/ShellExecution.tsx
  • src/components/ShellApprovalModal.tsx
  • src/pages/LogUpload/index.tsx

Test plan

  • Enable dark mode, navigate to all affected pages and verify text is readable
  • Toggle PII switches in PiiDiffViewer and Security settings — knob should be visible in both states
  • ImageGallery: open thumbnails, modal, check all labels
  • ShellExecution settings: all three tier cards should have readable text on distinct dark backgrounds
  • Approve/deny a Tier 2 command — badge in approval modal should be readable
  • LogUpload image tab: PII warning amber box should have readable text
  • npm run test:run → 268 pass, npx eslint . --max-warnings 0 → clean, npx tsc --noEmit → clean
## Summary - **Toggle switches** — knob was `bg-white` (invisible against `bg-muted` in dark mode); changed to `bg-background` - **ImageGallery** — thumbnail containers, filename labels, alert banners, and modal chrome used hardcoded gray/white with dark text; full `dark:` variants added throughout - **ShellExecution tier cards** — `TIER_CONFIG` used `bg-*-50` (near-white) backgrounds with dark text; replaced with `dark:bg-*-950/30` and light text colors for all three tiers - **ShellApprovalModal** — tier badge was hardcoded `bg-yellow-50`; dark variants added - **LogUpload PII alert** — `bg-amber-50/text-amber-800` became unreadable on dark background; added `dark:bg-amber-900/20` with lighter text ## Files changed - `src/components/PiiDiffViewer.tsx` - `src/pages/Settings/Security.tsx` - `src/components/ImageGallery.tsx` - `src/pages/Settings/ShellExecution.tsx` - `src/components/ShellApprovalModal.tsx` - `src/pages/LogUpload/index.tsx` ## Test plan - [ ] Enable dark mode, navigate to all affected pages and verify text is readable - [ ] Toggle PII switches in PiiDiffViewer and Security settings — knob should be visible in both states - [ ] ImageGallery: open thumbnails, modal, check all labels - [ ] ShellExecution settings: all three tier cards should have readable text on distinct dark backgrounds - [ ] Approve/deny a Tier 2 command — badge in approval modal should be readable - [ ] LogUpload image tab: PII warning amber box should have readable text - [ ] `npm run test:run` → 268 pass, `npx eslint . --max-warnings 0` → clean, `npx tsc --noEmit` → clean
sarman added 1 commit 2026-06-08 02:31:16 +00:00
fix(ui): correct font contrast and background colors in dark mode
All checks were successful
Test / frontend-tests (pull_request) Successful in 1m38s
Test / frontend-typecheck (pull_request) Successful in 1m40s
Test / rust-fmt-check (pull_request) Successful in 14m53s
Test / rust-tests (pull_request) Successful in 18m2s
Test / rust-clippy (pull_request) Successful in 15m46s
PR Review Automation / review (pull_request) Successful in 3m46s
d331e9c7c7
Replace hardcoded light-mode Tailwind colors with dark: variants
across six components. Issues that broke readability:

- PiiDiffViewer / Security: toggle knob was bg-white (invisible on
  bg-muted in dark mode) -> bg-background
- ImageGallery: thumbnail container, filename labels, alert banners,
  and modal chrome all used hardcoded gray/white backgrounds with dark
  text; added full dark: variants throughout
- ShellExecution TIER_CONFIG: tier cards used bg-green/yellow/red-50
  (near-white) with dark text; added dark:bg-*-950/30 backgrounds and
  light text for all three tiers
- ShellApprovalModal: tier 2 badge hardcoded bg-yellow-50/text-yellow-700;
  added dark: variants
- LogUpload: PII warning alert used bg-amber-50/text-amber-800; added
  dark:bg-amber-900/20 and lighter text for dark mode
sarman reviewed 2026-06-08 02:35:00 +00:00
sarman left a comment
Author
Owner

Automated PR Review (qwen36-35b-a3b-nvfp4 via liteLLM):\n\nSummary
The PR removes a critical security function (write_secure_temp_file) that enforced restrictive file permissions (0600) on kubeconfig files, replacing it with std::fs::write which creates files with default (world-readable) permissions. This exposes sensitive cluster credentials in the temporary directory to other users on the system, constituting a significant security vulnerability.

Findings

  • [BLOCKER] src-tauri/src/commands/kube.rs - Removal of secure temp file creation leads to exposure of cluster credentials in world-readable files
    Evidence: The diff shows write_secure_temp_file (which used std::os::unix::fs::OpenOptionsExt with mode(0o600) on Unix) being replaced by std::fs::write in multiple commands including test_kubectl_connection, discover_pods, list_namespaces, list_pods, etc. The function definition and its usage were removed entirely.
    Fix: Restore the write_secure_temp_file function or ensure all kubeconfig writes enforce restrictive permissions (0600) to prevent credential leakage to other local users.

Verdict: REQUEST CHANGES

Automated PR Review (qwen36-35b-a3b-nvfp4 via liteLLM):\n\n**Summary** The PR removes a critical security function (`write_secure_temp_file`) that enforced restrictive file permissions (0600) on kubeconfig files, replacing it with `std::fs::write` which creates files with default (world-readable) permissions. This exposes sensitive cluster credentials in the temporary directory to other users on the system, constituting a significant security vulnerability. **Findings** - [BLOCKER] src-tauri/src/commands/kube.rs - Removal of secure temp file creation leads to exposure of cluster credentials in world-readable files Evidence: The diff shows `write_secure_temp_file` (which used `std::os::unix::fs::OpenOptionsExt` with `mode(0o600)` on Unix) being replaced by `std::fs::write` in multiple commands including `test_kubectl_connection`, `discover_pods`, `list_namespaces`, `list_pods`, etc. The function definition and its usage were removed entirely. Fix: Restore the `write_secure_temp_file` function or ensure all kubeconfig writes enforce restrictive permissions (0600) to prevent credential leakage to other local users. **Verdict**: REQUEST CHANGES
sarman added 1 commit 2026-06-08 14:47:45 +00:00
Merge branch 'master' into fix/dark-mode-font-contrast
Some checks failed
PR Review Automation / review (pull_request) Has been cancelled
Test / rust-tests (pull_request) Has been cancelled
Test / rust-fmt-check (pull_request) Has been cancelled
Test / frontend-tests (pull_request) Has been cancelled
Test / rust-clippy (pull_request) Has been cancelled
Test / frontend-typecheck (pull_request) Has been cancelled
007897a952
sarman merged commit 58edc75ab5 into master 2026-06-08 14:47:59 +00:00
sarman deleted branch fix/dark-mode-font-contrast 2026-06-08 14:48:00 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sarman/tftsr-devops_investigation#84
No description provided.