Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 68 additions & 30 deletions design/hide-screens.pen
Original file line number Diff line number Diff line change
Expand Up @@ -1408,6 +1408,10 @@
"type": "number",
"value": 280
},
"--size-usage-popover": {
"type": "number",
"value": 250
},
"--size-pr-popover": {
"type": "number",
"value": 360
Expand Down Expand Up @@ -1723,14 +1727,28 @@
}
}
}
},
{
"id": "main-sidebar-settings-l",
"type": "ref",
"ref": "hideui:Nyvom",
"name": "Icon",
"width": 20,
"height": 20,
"descendants": {
"hideui:ZIZFR": {
"fill": "$--muted-foreground",
"icon": "settings"
}
}
}
],
"width": "fill_container",
"gap": "$--spacing-xs",
"alignItems": "center"
}
],
"width": 220,
"width": 292,
"layout": "vertical",
"gap": "$--spacing-md",
"fill": "$--sidebar",
Expand Down Expand Up @@ -2076,14 +2094,28 @@
}
}
}
},
{
"id": "main-sidebar-settings-d",
"type": "ref",
"ref": "hideui:Nyvom",
"name": "Icon",
"width": 20,
"height": 20,
"descendants": {
"hideui:ZIZFR": {
"fill": "$--muted-foreground",
"icon": "settings"
}
}
}
],
"width": "fill_container",
"gap": "$--spacing-xs",
"alignItems": "center"
}
],
"width": 220,
"width": 292,
"layout": "vertical",
"gap": "$--spacing-md",
"fill": "$--sidebar",
Expand Down Expand Up @@ -4644,7 +4676,7 @@
"layout": "horizontal",
"justifyContent": "space_between",
"alignItems": "center",
"width": 1176
"width": 1248
},
{
"type": "frame",
Expand Down Expand Up @@ -4852,14 +4884,28 @@
}
}
}
},
{
"id": "ws-sidebar-settings-l",
"type": "ref",
"ref": "hideui:Nyvom",
"name": "Icon",
"width": 20,
"height": 20,
"descendants": {
"hideui:ZIZFR": {
"fill": "$--muted-foreground",
"icon": "settings"
}
}
}
],
"width": "fill_container",
"gap": "$--spacing-xs",
"alignItems": "center"
}
],
"width": 220,
"width": 292,
"layout": "vertical",
"gap": "$--spacing-md",
"fill": "$--sidebar",
Expand Down Expand Up @@ -5395,7 +5441,7 @@
],
"layout": "vertical",
"gap": "$--spacing-md",
"width": 1176
"width": 1248
}
],
"theme": {
Expand Down Expand Up @@ -5570,7 +5616,7 @@
"layout": "horizontal",
"justifyContent": "space_between",
"alignItems": "center",
"width": 1176
"width": 1248
},
{
"type": "frame",
Expand Down Expand Up @@ -5778,14 +5824,28 @@
}
}
}
},
{
"id": "ws-sidebar-settings-d",
"type": "ref",
"ref": "hideui:Nyvom",
"name": "Icon",
"width": 20,
"height": 20,
"descendants": {
"hideui:ZIZFR": {
"fill": "$--muted-foreground",
"icon": "settings"
}
}
}
],
"width": "fill_container",
"gap": "$--spacing-xs",
"alignItems": "center"
}
],
"width": 220,
"width": 292,
"layout": "vertical",
"gap": "$--spacing-md",
"fill": "$--sidebar",
Expand Down Expand Up @@ -6321,7 +6381,7 @@
],
"layout": "vertical",
"gap": "$--spacing-md",
"width": 1176
"width": 1248
}
],
"theme": {
Expand Down Expand Up @@ -8058,17 +8118,6 @@
"fontFamily": "$--font-ui",
"fontSize": "$--text-caption",
"fontWeight": "400"
},
{
"type": "icon",
"id": "pal-side-settings-l",
"name": "Glyph",
"enabled": true,
"width": 14,
"height": 14,
"icon": "settings",
"library": "lucide",
"fill": "$--muted-foreground"
}
],
"layout": "horizontal",
Expand Down Expand Up @@ -9741,17 +9790,6 @@
"fontFamily": "$--font-ui",
"fontSize": "$--text-caption",
"fontWeight": "400"
},
{
"type": "icon",
"id": "pal-side-settings-d",
"name": "Glyph",
"enabled": true,
"width": 14,
"height": 14,
"icon": "settings",
"library": "lucide",
"fill": "$--muted-foreground"
}
],
"layout": "horizontal",
Expand Down
24 changes: 14 additions & 10 deletions design/hide-ui.lib.pen
Original file line number Diff line number Diff line change
Expand Up @@ -28554,7 +28554,7 @@
"id": "usage-row",
"name": "Component / Usage row",
"reusable": true,
"width": 248,
"width": 218,
"layout": "vertical",
"gap": "$--spacing-xs",
"children": [
Expand Down Expand Up @@ -28644,7 +28644,7 @@
"type": "frame",
"id": "usage-row-fill",
"name": "Used share",
"width": 154,
"width": 135,
"height": 4,
"fill": "$--success",
"cornerRadius": "$--radius-xs",
Expand Down Expand Up @@ -28800,7 +28800,7 @@
"type": "frame",
"id": "usage-popover-available",
"name": "Popover",
"width": 280,
"width": 250,
"layout": "vertical",
"gap": "$--spacing-md",
"padding": "$--spacing-lg",
Expand Down Expand Up @@ -28887,7 +28887,7 @@
"enabled": true
},
"usage-row-fill": {
"width": 154,
"width": 135,
"fill": "$--success"
},
"usage-row-note": {
Expand Down Expand Up @@ -28927,7 +28927,7 @@
"enabled": true
},
"usage-row-fill": {
"width": 15,
"width": 13,
"fill": "$--success"
},
"usage-row-note": {
Expand Down Expand Up @@ -28976,7 +28976,7 @@
"enabled": true
},
"usage-row-fill": {
"width": 146,
"width": 129,
"fill": "$--success"
},
"usage-row-note": {
Expand Down Expand Up @@ -29012,7 +29012,7 @@
"type": "frame",
"id": "usage-popover-first-read",
"name": "Popover",
"width": 280,
"width": 250,
"layout": "vertical",
"gap": "$--spacing-md",
"padding": "$--spacing-lg",
Expand Down Expand Up @@ -29216,7 +29216,7 @@
"enabled": true
},
"usage-row-fill": {
"width": 201,
"width": 177,
"fill": "$--warning"
},
"usage-row-note": {
Expand Down Expand Up @@ -29256,7 +29256,7 @@
"enabled": true
},
"usage-row-fill": {
"width": 233,
"width": 205,
"fill": "$--destructive"
},
"usage-row-note": {
Expand Down Expand Up @@ -29295,7 +29295,7 @@
"enabled": true
},
"usage-row-fill": {
"width": 57,
"width": 50,
"fill": "$--success"
},
"usage-row-note": {
Expand Down Expand Up @@ -30848,6 +30848,10 @@
"--size-agent-children-popover": {
"type": "number",
"value": 280
},
"--size-usage-popover": {
"type": "number",
"value": 250
}
},
"fileToken": "61e6a599-bafe-4c87-80e7-10732d9e7fe4",
Expand Down
4 changes: 4 additions & 0 deletions design/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,10 @@
"type": "number",
"value": 280
},
"--size-usage-popover": {
"type": "number",
"value": 250
},
"--size-pr-popover": {
"type": "number",
"value": 360
Expand Down
2 changes: 1 addition & 1 deletion docs/UI_BEHAVIOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ The web shell draws the same trigger and list at the bottom of its sidebar from
Web owner: `web/src/components/weekly-usage.tsx`, `web/src/usage.ts`. Native owner: the sidebar utility bar's usage button and `HideUsagePopover`.
The core reads the numbers and names each row's state (`navigator.provider_usage`, [AI_PROVIDERS.md: weekly usage display](AI_PROVIDERS.md#weekly-usage-display)); the shells only draw them.

The sidebar footer carries one chip per provider at its right, beside the device picker: the provider mark and the rounded percent of the seven-day window.
The sidebar footer reads, as the native utility bar does, the device picker at its left, then one chip per provider and the Settings gear at its right; a chip is the provider mark and the rounded percent of the seven-day window.
A percent reads in the success color below 70, the warning color from 70 and the destructive color from 90.
A provider that is loading or unavailable is a dimmed mark with no percent; a stale or fallback reading keeps its percent.
The chips' accessible name lists every provider with its reading.
Expand Down
20 changes: 11 additions & 9 deletions scripts/pen-screens.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,11 @@ function screenUsageChip(id, {provider, value}) {
// The Agents/Projects sidebar App.tsx/sidebar.tsx always shows beside a
// screen's own content; every sheet that draws a whole screen (Main,
// Workspace) includes it so a reader sees the whole thing, not just its
// own feature in isolation.
function screenSidebar(id, suffix, agents) {
return frame(`${id}-${suffix}`, 'Sidebar', {width: 220, layout: 'vertical', gap: '$--spacing-md', fill: '$--sidebar', padding: '$--spacing-md', cornerRadius: '$--radius-md'}, [
// own feature in isolation. It is --size-sidebar-ideal wide, as sidebar.tsx
// draws it, so its footer holds the device picker, the usage chips and the
// Settings gear side by side.
function screenSidebar(tokens, id, suffix, agents) {
return frame(`${id}-${suffix}`, 'Sidebar', {width: num(tokens, '--size-sidebar-ideal'), layout: 'vertical', gap: '$--spacing-md', fill: '$--sidebar', padding: '$--spacing-md', cornerRadius: '$--radius-md'}, [
frame(`${id}-tabs-${suffix}`, 'Tabs', {layout: 'horizontal', gap: '$--spacing-md'}, [
text(`${id}-agentstab-${suffix}`, 'Agents', {weight: '600'}),
text(`${id}-projectstab-${suffix}`, 'Projects', {fill: '$--muted-foreground'}),
Expand All @@ -350,6 +352,7 @@ function screenSidebar(id, suffix, agents) {
frame(`${id}-footergap-${suffix}`, 'Gap', {width: 'fill_container', height: 1}, []),
screenUsageChip(`${id}-usage0-${suffix}`, {provider: 'claude', value: '62%'}),
screenUsageChip(`${id}-usage1-${suffix}`, {provider: 'codex', value: '59%'}),
screenIconButton(`${id}-settings-${suffix}`, 'settings', {size: 20}),
]),
]);
}
Expand All @@ -358,7 +361,7 @@ function screenSidebar(id, suffix, agents) {

function buildMain(tokens) {
function build(suffix) {
const sidebar = screenSidebar('main-sidebar', suffix, [
const sidebar = screenSidebar(tokens, 'main-sidebar', suffix, [
{title: '두 번째 에이전트', status: 'Working'},
{title: 'Agent one', status: 'Seen', statusColor: '$--muted-foreground'},
]);
Expand Down Expand Up @@ -495,11 +498,11 @@ function screenPaneHeader(id, {label, status, width}) {
]);
}

function buildWorkspace() {
const SIDEBAR_W = 220, AGENT_W = 300, VIEW_W = 380, EXPLORER_W = 240;
function buildWorkspace(tokens) {
const SIDEBAR_W = num(tokens, '--size-sidebar-ideal'), AGENT_W = 300, VIEW_W = 380, EXPLORER_W = 240;
const TOTAL_W = SIDEBAR_W + AGENT_W + VIEW_W + EXPLORER_W + 3 * 12;
function chrome(suffix) {
const sidebar = screenSidebar('ws-sidebar', suffix, [
const sidebar = screenSidebar(tokens, 'ws-sidebar', suffix, [
{title: 'Agent two', status: 'Working'},
{title: 'Agent one', status: 'Seen', statusColor: '$--muted-foreground'},
]);
Expand Down Expand Up @@ -741,7 +744,6 @@ function buildPalette(tokens) {
text(id('side-projects'), 'Projects', {size: '$--text-caption', fill: '$--muted-foreground'}),
frame(id('side-gap'), 'Spacer', {width: 'fill_container', height: 1}, []),
text(id('side-e'), '⌘E', {size: '$--text-caption', fill: '$--muted-foreground'}),
icon(id('side-settings'), 'settings', {size: num(tokens, '--size-icon'), fill: '$--muted-foreground'}),
]),
frame(id('side-searchwrap'), 'Search', {width: SIDEBAR, padding: [0, '$--spacing-md']}, [
frame(id('side-search'), 'Search field', {
Expand Down Expand Up @@ -911,7 +913,7 @@ export function screenSheets(tokens, root) {
return [
{name: 'Screen / Main', build: () => buildMain(tokens)},
{name: 'Screen / Project Overview', build: () => buildProjectOverview(tokens)},
{name: 'Screen / Workspace', build: () => buildWorkspace()},
{name: 'Screen / Workspace', build: () => buildWorkspace(tokens)},
{name: 'Screen / Project Sessions', build: () => buildSessions()},
{name: 'Screen / Settings', build: () => buildSettings(tokens)},
{name: 'Screen / Palette', build: () => buildPalette(tokens)},
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/weekly-usage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function WeeklyUsage({ actions }: { actions: Actions }) {
))}
</PopoverTrigger>
</Hint>
<PopoverContent side="top" className="flex w-(--size-agent-children-popover) flex-col gap-md p-lg" data-usage-popover="true">
<PopoverContent side="top" className="flex w-(--size-usage-popover) flex-col gap-md p-lg" data-usage-popover="true">
<div className="flex items-baseline gap-sm">
<span className="min-w-0 flex-1 text-subhead font-semibold text-foreground">Weekly Usage</span>
<span className="shrink-0 font-mono text-micro font-semibold text-muted-foreground">7 days</span>
Expand Down
Loading
Loading