-
Notifications
You must be signed in to change notification settings - Fork 2
Polish Saar v1: visual foundation + audit fixes [GET-13] #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DevanshuNEU
merged 25 commits into
OpenCodeIntel:main
from
DevanshuNEU:feat/lco-13-v1-polish
Apr 26, 2026
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
a763b12
fix(banner): copy + light/dark + focus ring [GET-13]
DevanshuNEU a9bbe89
fix(inject): skip tee + decoder on non-SSE responses [GET-13]
DevanshuNEU a793c9c
test(inject): cover non-SSE response branch [GET-13]
DevanshuNEU 52d1925
chore(overlay): init nudge className at mount [GET-13]
DevanshuNEU 5b18bf4
style: purge emdashes from ui/ + lib/ comments [GET-13]
DevanshuNEU 49c7c7e
feat(theme): workshop palette tokens [GET-13]
DevanshuNEU 5426358
feat(typography): hierarchy + theme overrides [GET-13]
DevanshuNEU 1bac4f9
feat(header): saar sigil + settings trigger [GET-13]
DevanshuNEU b7d1b87
feat(settings): theme + density drawer [GET-13]
DevanshuNEU 765b008
feat(ticker): per-turn cost bars on active conversation [GET-13]
DevanshuNEU f282962
feat(format): label api-equivalent cost on flat-rate plans [GET-13]
DevanshuNEU 4d72796
fix(typography): demote subject to sans, lift budget hero [GET-13]
DevanshuNEU 2de0788
fix(format): drop API rate suffix, let the approx symbol carry it [GE…
DevanshuNEU f6455d0
fix(header): bump gear to 18px outline glyph [GET-13]
DevanshuNEU a0130e9
fix(header): drop sigil for SAAR wordmark placeholder [GET-13]
DevanshuNEU 78123d3
fix(today): drop duplicate label, section header carries it [GET-13]
DevanshuNEU 38f292c
fix(active): compute context pct from tokens, not stored field [GET-13]
DevanshuNEU 55c0919
fix(ticker): trend reports absolute pp delta, not relative [GET-13]
DevanshuNEU 4688504
fix(inject): extract SSE gate to canonical module + tighten match [GE…
DevanshuNEU 3cf1419
fix(settings): harden read path against bad data and read failures [G…
DevanshuNEU 01f43b1
fix(settings): drop dead Cmd+, accelerator hook [GET-13]
DevanshuNEU 36d34c5
fix(banner): handle storage.set rejection on enable click [GET-13]
DevanshuNEU d11e2b1
fix(active): trust pricing helper for context window fallback [GET-13]
DevanshuNEU f6d627a
test(active+ticker): pin trend and context% derivations [GET-13]
DevanshuNEU 37f3dd4
chore(ci): bump claude-ai.js bundle limit to 100 KB [GET-13]
DevanshuNEU File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,70 @@ | ||
| // entrypoints/sidepanel/components/Header.tsx | ||
| // Logo placeholder + title. Clean, minimal header. | ||
| // Side panel header. Wordmark on the left, gear on the right. | ||
| // | ||
| // Logo is intentionally absent. Devanshu is designing the real mark and we | ||
| // don't want to ship a placeholder sigil that competes with the eventual | ||
| // custom letterform (the AA-merger concept). Until then the wordmark itself | ||
| // carries the brand: thin geometric all-caps with generous tracking, set in | ||
| // the user's system display sans so we ship zero webfont weight in this PR. | ||
|
|
||
| import React from 'react'; | ||
|
|
||
| export default function Header() { | ||
| interface Props { | ||
| /** Invoked when the user clicks the gear. App.tsx wires this to the | ||
| * SettingsDrawer's open state. */ | ||
| onOpenSettings: () => void; | ||
| } | ||
|
|
||
| export default function Header({ onOpenSettings }: Props) { | ||
| return ( | ||
| <header className="lco-dash-header"> | ||
| <div className="lco-dash-logo" aria-label="Saar logo placeholder" /> | ||
| <div className="lco-dash-header-text"> | ||
| <h1 className="lco-dash-title">Saar</h1> | ||
| <h1 className="lco-dash-title">SAAR</h1> | ||
| <p className="lco-dash-subtitle">AI Usage Coach</p> | ||
| </div> | ||
| <button | ||
| className="lco-dash-header-gear" | ||
| onClick={onOpenSettings} | ||
| aria-label="Open settings" | ||
| type="button" | ||
| > | ||
| <GearIcon /> | ||
| </button> | ||
| </header> | ||
| ); | ||
| } | ||
|
|
||
| /** | ||
| * 18px gear glyph. Crisper outline than the typical 16px Material gear, | ||
| * sits at a comfortable size against the 24px Saar wordmark. Uses | ||
| * currentColor so it picks up muted text by default and accent on hover | ||
| * (rules in dashboard.css). | ||
| */ | ||
| function GearIcon(): React.ReactElement { | ||
| return ( | ||
| <svg | ||
| width={18} | ||
| height={18} | ||
| viewBox="0 0 24 24" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| aria-hidden="true" | ||
| > | ||
| <path | ||
| fill="none" | ||
| stroke="currentColor" | ||
| strokeWidth="1.75" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| d="M12 9.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" | ||
| /> | ||
| <path | ||
| fill="none" | ||
| stroke="currentColor" | ||
| strokeWidth="1.75" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z" | ||
| /> | ||
| </svg> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| // entrypoints/sidepanel/components/SettingsDrawer.tsx | ||
| // User preferences live behind the gear icon in the header. Renders as a | ||
| // native <dialog> so we get focus trap, Escape-to-close, and inert backdrop | ||
| // for free. Two settings ship in this PR: theme and density. Notification | ||
| // thresholds, currency, and other coaching-flavored preferences land | ||
| // alongside their feature commits in GET-21 / GET-22 / GET-28. | ||
|
|
||
| import React, { useEffect, useRef } from 'react'; | ||
| import { useSettings, type ThemeChoice, type DensityChoice } from '../hooks/useSettings'; | ||
|
|
||
| interface Props { | ||
| open: boolean; | ||
| onClose: () => void; | ||
| } | ||
|
|
||
| /** | ||
| * Theme swatches rendered as a radiogroup. Order is intentional: | ||
| * system -> dawn -> dusk -> void | ||
| * mirrors a brightness gradient from "follow OS" through light to true black. | ||
| */ | ||
| const THEMES: { id: ThemeChoice; label: string; description: string; previewClass: string }[] = [ | ||
| { id: 'system', label: 'system', description: 'Follow your OS', previewClass: 'lco-swatch-preview--system' }, | ||
| { id: 'dawn', label: 'dawn', description: 'Warm light', previewClass: 'lco-swatch-preview--dawn' }, | ||
| { id: 'dusk', label: 'dusk', description: 'Standard dark', previewClass: 'lco-swatch-preview--dusk' }, | ||
| { id: 'void', label: 'void', description: 'OLED black', previewClass: 'lco-swatch-preview--void' }, | ||
| ]; | ||
|
|
||
| const DENSITIES: { id: DensityChoice; label: string; description: string }[] = [ | ||
| { id: 'comfortable', label: 'comfortable', description: 'Generous spacing' }, | ||
| { id: 'compact', label: 'compact', description: 'Tighter rows' }, | ||
| ]; | ||
|
|
||
| export default function SettingsDrawer({ open, onClose }: Props): React.ReactElement | null { | ||
| const { settings, set, ready } = useSettings(); | ||
| const dialogRef = useRef<HTMLDialogElement>(null); | ||
|
|
||
| // Show / hide the dialog imperatively so the browser handles focus trap | ||
| // and modal semantics. showModal() throws if already open; we guard by | ||
| // reading the current state. | ||
| useEffect(() => { | ||
| const dialog = dialogRef.current; | ||
| if (!dialog) return; | ||
| if (open && !dialog.open) { | ||
| dialog.showModal(); | ||
| } else if (!open && dialog.open) { | ||
| dialog.close(); | ||
| } | ||
| }, [open]); | ||
|
|
||
| if (!ready) return null; | ||
|
DevanshuNEU marked this conversation as resolved.
|
||
|
|
||
| return ( | ||
| <dialog | ||
| ref={dialogRef} | ||
| className="lco-settings" | ||
| onClose={onClose} | ||
| aria-label="Saar settings" | ||
| > | ||
| <header className="lco-settings-head"> | ||
| <span className="lco-settings-title lco-section">settings</span> | ||
| <button | ||
| className="lco-settings-close" | ||
| onClick={onClose} | ||
| aria-label="Close settings" | ||
| type="button" | ||
| > | ||
| {'✕'} | ||
| </button> | ||
| </header> | ||
|
|
||
| <div className="lco-settings-body"> | ||
| <section className="lco-settings-block"> | ||
| <span className="lco-label" id="lco-theme-label">theme</span> | ||
| <div | ||
| className="lco-swatches" | ||
| role="radiogroup" | ||
| aria-labelledby="lco-theme-label" | ||
| > | ||
| {THEMES.map((theme) => { | ||
| const selected = settings.theme === theme.id; | ||
| return ( | ||
| <button | ||
| key={theme.id} | ||
| role="radio" | ||
| aria-checked={selected} | ||
| className={`lco-swatch ${selected ? 'lco-swatch--on' : ''}`} | ||
| onClick={() => set({ theme: theme.id })} | ||
| type="button" | ||
| > | ||
| <span className={`lco-swatch-preview ${theme.previewClass}`} aria-hidden="true" /> | ||
| <span className="lco-swatch-label">{theme.label}</span> | ||
| <span className="lco-swatch-desc">{theme.description}</span> | ||
| </button> | ||
| ); | ||
| })} | ||
| </div> | ||
| </section> | ||
|
|
||
| <section className="lco-settings-block"> | ||
| <span className="lco-label" id="lco-density-label">density</span> | ||
| <div | ||
| className="lco-density-options" | ||
| role="radiogroup" | ||
| aria-labelledby="lco-density-label" | ||
| > | ||
| {DENSITIES.map((d) => { | ||
| const selected = settings.density === d.id; | ||
| return ( | ||
| <button | ||
| key={d.id} | ||
| role="radio" | ||
| aria-checked={selected} | ||
| className={`lco-density-option ${selected ? 'lco-density-option--on' : ''}`} | ||
| onClick={() => set({ density: d.id })} | ||
| type="button" | ||
| > | ||
| <span className="lco-density-label-text">{d.label}</span> | ||
| <span className="lco-density-desc">{d.description}</span> | ||
| </button> | ||
| ); | ||
| })} | ||
| </div> | ||
| </section> | ||
| </div> | ||
| </dialog> | ||
| ); | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.