Skip to content

ux: status bar severity color + what's-new notification#20

Merged
dmartinochoa merged 1 commit into
scan-workspace-v2from
ux-polish-2
May 19, 2026
Merged

ux: status bar severity color + what's-new notification#20
dmartinochoa merged 1 commit into
scan-workspace-v2from
ux-polish-2

Conversation

@dmartinochoa
Copy link
Copy Markdown
Member

Summary

Two UX improvements from the post-v0.2.0 review. Stacked on #19 (scan-workspace-v2) — base is scan-workspace-v2, so the diff shows only this PR's work.

1. Status bar severity color 🔴 🟡

A workspace with CRITICAL findings now tints the status bar to statusBarItem.errorBackground (red); HIGH-without-CRITICAL tints to statusBarItem.warningBackground (yellow); MEDIUM / LOW / INFO keep the default fg colour so a "1 medium" workspace doesn't shout. Same ThemeColor tokens ESLint and Error Lens use — the visual language reads correctly across themes.

```
$(shield) 3C 1H ← red background (CRITICAL present)
$(shield) 4H 2M ← yellow background (HIGH, no CRITICAL)
$(shield) 5 ← default colour (medium/low only)
$(shield) clean ← default colour (zero findings)
```

2. What's-new notification on upgrade

First activation after a version bump shows a one-time toast — "Pipeline-Check 0.X.Y is here. The Findings panel, status bar item, inline CodeLens, and Alt+F8 navigation are new — see what changed?" — with a See release notes button that opens the matching GitHub release URL.

Persistence is write-before-show: the seen-version saves before the toast fires, so a missed dismissal (VS Code closes, user clicks elsewhere) doesn't loop next launch. A v0.1.x → v0.2.0 upgrade fires it once; subsequent launches stay silent.

Pre-release strip: `v0.2.0-rc.1` → `v0.2.0` won't re-trigger.

What user-edits ride along

Three intentional edits the user committed to the working tree are folded in:

  • package.json dropped `onStartupFinished` from activationEvents — the activity-bar slot only appears in CI-relevant workspaces now, matching the status bar's already-quieter visibility policy.
  • package.json expanded `untrustedWorkspaces.description` to explain the `machine-overridable` scope on `serverCommand` / `serverArgs`. Better copy for the trust prompt VS Code surfaces on first open.
  • README.md added a Socket supply-chain badge.

Test plan

  • `npm run lint` clean
  • `npm run compile` clean
  • `npm test` — 129 tests pass (was 107 on feat: pipelineCheck.scanWorkspace + refresh-as-scan (R10, R15) #19; +5 statusBar, +17 whatsNew)
  • `npm run smoke` clean
  • Manual smoke under F5: open a fixture with CRITICAL findings → status bar reads red; clear the diagnostics → status bar returns to default colour.
  • Manual upgrade test: install v0.2.0 cleanly, then dev-load this build, confirm the "what's new" toast fires once; restart VS Code, confirm it's silent.

Notes for v0.3.0 release

When you cut v0.3.0 (or whatever the next release is), the what's-new notification will fire once on first activation for every existing user — that's the whole point. The Findings-panel / status bar / CodeLens / Alt+F8 mentions in the message are deliberate: those land/landed in the v0.2.x line.

🤖 Generated with Claude Code

Stacked on scan-workspace-v2 (#19). Two UX improvements from the
post-v0.2.0 review.

1. Status bar severity color
- pickBackgroundColor returns statusBarItem.errorBackground (red)
  when CRITICAL is present, statusBarItem.warningBackground (yellow)
  for HIGH-without-CRITICAL, undefined for MEDIUM/LOW/INFO. Same
  ThemeColor tokens ESLint and Error Lens use, so the visual
  language reads correctly across themes.
- The default fg colour for medium/low/info keeps a "1 medium"
  workspace from shouting.

2. What's-new notification (src/whatsNew.ts)
- First activation after a version bump shows a one-time toast.
  "See release notes" opens the matching GitHub release URL via
  vscode.env.openExternal.
- isUpgrade compares the manifest version against the value stashed
  in globalState; strips a leading 'v' and any pre-release suffix
  (-rc.1) so a stable release after an rc doesn't re-trigger.
- The seen-version persists BEFORE the notification fires, so a
  missed dismissal doesn't loop next launch.
- composeMessage and isUpgrade are pure helpers; the test file
  pins every documented invariant.

Also riding along (user-intentional edits already in the working tree)
- package.json: dropped onStartupFinished from activationEvents — the
  activity-bar slot only appears in CI-relevant workspaces, matching
  the status bar's already-quieter visibility policy.
- package.json: expanded untrustedWorkspaces.description to explain
  the machine-overridable scope on serverCommand/serverArgs. Better
  copy for the trust prompt VS Code shows on first open.
- README.md: Socket supply-chain badge added.

Tests
- statusBar.test.ts: 5 new tests for pickBackgroundColor (critical /
  high-without-critical / medium-only / clean / mixed). Updated the
  inline vscode stub to expose ThemeColor.
- whatsNew.test.ts (new): 17 tests across isUpgrade (first install,
  major/minor/patch upgrades, downgrade, equal, pre-release strip,
  leading-v strip, malformed prev), composeMessage (version
  interpolation, mentions every surface), and showWhatsNewIfUpgraded
  (shows on first install, skips on match, persists before showing,
  opens URL on click, doesn't open on dismiss, supports custom
  openExternal for tests).

Total: 129 unit tests (was 107 on PR #19; +5 status bar, +17 whatsNew).
Lint, compile, smoke all green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c4a8b677-18d1-4bfe-857d-050f008fb3db

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ux-polish-2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dmartinochoa dmartinochoa merged commit 14c494e into scan-workspace-v2 May 19, 2026
1 check passed
@dmartinochoa dmartinochoa deleted the ux-polish-2 branch May 19, 2026 23:46
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