跳转至

macOS 菜单栏额度面板

迁自 DESIGN.md §4,规范效力不变。文中未注明文档的 §N 均指 DESIGN.md。

macOS menu bar quota panel (owner-approved v6 prototype, 2026-10-11)

Windows 托盘面板(2026-11-18)沿用这里的内容顺序、默认任务数量、管理/账号详情/用量详情、 品牌资产与数字字体。鼠标在 Windows 托盘图标上连续悬停 100 毫秒后展示预热窗口,移入卡片后可以继续操作。 卡片只由悬停触发:左键单击保持原有行为,收起卡片并直接打开主窗口;右键收起卡片并弹出托盘菜单。 卡片收起时不展示额度,因此不算额度读取的使用者:只在卡片可见期间读取;开启「低额度提醒」时提醒需要后台读数, 才在收起后继续读取。启动时读取一次作为首帧,收起后保留最后一帧供下次展开直接显示,换账号立即清空。 鼠标停在图标上就会展开,所以展开不能决定请求频率:展开触发的全量刷新最多每 60 秒一次,其间再次展开只复用已有读数; 收起后继续持有读数 3 分钟且不发起新的读取,鼠标来回划过图标不会重新采集。 动效与 Mac 面板同曲线同时长(Swift 的 Motion),调整时两端同步:液柱液面与 TubeView/LiquidSurface 同形同参 (展开时升起并左右晃动后静止,与管壁以圆角相接,有任务在用的账号保持细波纹,鼠标移入时轻晃),额度与月度金额从零滚动到位, 额度列悬停上抬、按下回弹,翻页时离开的页面滑出后才移除,详情圆环逐环绘出,「打开 Cindy」的品牌箭头滑入, 刷新图标转一圈,运行中任务的图标向外扩散一圈细线。波纹与扩散线是仅有的两处循环动效,只在卡片可见时运行; 开启「减少动态效果」时全部静止。液面与数值滚动在 src/renderer/quota-tray-tube.tsx,其余在 styles/quota-tray.css。 首页和详情按内容测量高度,仅超过屏幕可用高度的 86% 才滚动。所有页面复用 QuotaPanelController 的取数、隐私处理、设置持久化和操作派发。 额度列的间距、管宽与数值排版跟随 Swift 的 Cells/CellView:超过 6 个额度时列间距从 8px 收为 4px;管子最宽 40px, 列更窄时随列收窄,液面按管子实际宽度绘制;管子上方的数值固定占一行 22px 高(额度 18px、余额 16px、 % 号 11px;credits 为 14px 数额叠 10px 单位,守 10px 字号下限,比 Swift 的 15pt/8pt 略高出数值行), 所有管子顶端对齐。数值放不下时整体缩小到列宽,不换行也不压到相邻列;Swift 的 minimumScaleFactor 缩到 75% 后截断,Windows 继续缩小以完整显示金额(2026-11-22,九个额度时「100」与「%」分成两行、 「¥90.20」压到相邻列)。推荐账号的描边画在管壁内侧,管子尺寸不变。重置时间仍是 11px 单行,放不下时省略。

两端的尺寸、短屏密度和语义色正本在 src/shared/quotaPanelDesign.ts(相对 Desktop); controller 随视图发送,Swift 的 PanelDesign/Palette 与 Windows 的 CSS 变量共同消费。 Swift 内的旧值只供旧预览数据缺字段时兼容,调整设计时改共享正本。平台渲染器仍各自维护页面 结构和原生交互,新增控件须同时适配;Mac 的系统模糊材质与 Windows 的背景合成各自由平台负责。 Windows 回归入口为 pnpm ui:check --page quota-tray --case all --theme all --locale all, 覆盖首页任务裁剪、管理、账号详情、用量详情与品牌按钮,以及九个额度并排时的对齐(crowded); Mac 仍须运行原生 helper 验证。

Received shared subscriptions (owner correction, 2026-11-05): while the panel is open, authorized weekly allowances use the existing tube and detail layout. The tube shows the sharer’s existing display name (for example dash), falling back to the provider label when absent; detail title places the sharer first, followed by the provider, so a long provider label cannot hide who shared it. The update fact says the localized “Shared by ”. This uses the received-share directory identity, never a quota account email or device identity. When Hide personal information is enabled, project every sharer label to the provider brand across tubes, recommendation copy, management rows, detail titles and update facts; do not emit the original nickname. Turning privacy off restores the received name without changing the quota. For groups or multiple accounts, select the readable ready account with the highest unexpired weekly percentage; take all detail windows, reset times and update time from that same account. Partial results may use the readable subset. Label the detail “Shared · highest weekly” and explain that this is the highest readable account allowance, not a combined or personal allowance; selection does not promise a routing destination. A single-account share keeps the existing “Shared” label and account-wide notice. Use neutral detail rings, without account email, device identity, reset-credit controls or local-provider task selection. Unavailable/expired/balance-only accounts do not participate; no eligible account means no tube. Manual refresh within the same owner/share identity retains the displayed source until the new result arrives, so an open detail stays open. Repeated refreshes join the current pending batch instead of stacking requests; a reopened panel or changed identity/relationship starts a new lease without reusing old results; a confirmed failure or unavailable permission removes that share immediately, without waiting for pending siblings. Owner/share changes and closing the panel clear readings immediately. Subscribe to synchronous session invalidation so clearing starts at the account boundary, before asynchronous sign-out cleanup or auth notifications finish. If identity invalidation leaves no usable overview, immediately publish an empty account-free native view instead of waiting for collection: signed-out users see the existing sign-in gate, while a signed-in account switch waits empty for its new build. Access-epoch changes invalidate only affected shares even with unchanged directory DTOs; refusal notifications do not immediately query again or cancel healthy sibling reads, and retries follow the bounded five-second polling schedule. Published windows reproject at their local reset deadline, independently of network refresh, removing expired values or selecting a still-live group account. Authorized raw snapshots for this projection are kept only for the visible-panel lease and cleared on invalidation/close. The same layout applies in every locale and appearance.

Icon refinement reference (2026-10-18, macOS AppKit rendering; enlarged and actual 18pt size): Light/Dark before and after.

  • Remote control uses the same active-controller set as the in-app connection indicator. Its menu-bar dot uses a brighter orange (#FF9F0A, owner correction, 2026-10-25). The 5pt dot sits near the icon's upper-left corner, centered at (4.5pt, 4.5pt), with a 0.75pt transparent rim, without widening the 18pt icon or moving the unread count. Release builds light it only for active controllers and clear it when the last one leaves; development builds temporarily keep it visible for visual tuning. The number uses 13pt regular monospaced digits with a thin space after the icon. The native menu item and its settings preview use the same artwork (owner request, 2026-10-25).
  • When the remote-control dot is visible, the main panel explains it directly below the wordmark: a neutral computer symbol with the same orange dot, “Remote control active”, and the active devices' names, joined by middle dots (owner request, 2026-10-26). Names update on connection, disconnection and rename even while usage collection is pending; two visible lines keep the strip compact, with the full list available on hover and to accessibility. The entire row opens Settings → Remote control through the existing main-window navigation, with a quiet chevron and hover fill. This status strip stays above the scrolling quota content, shares the panel's warm neutrals and translucent backdrop, and ends with the existing inset hairline. Development preview without a real controller keeps the generic explanation rather than inventing a device name, including on the sign-in panel. Both appearances and every locale in SUPPORTED_LOCALES share this layout.
  • A native status item (NSStatusItem) and panel rendered by the Swift helper in apps/desktop/native/menubar/, not an HTML window. Main builds every sentence and value; the helper renders, animates and formats only times that tick while the panel is open. Its motion, including the two running markers in the task lists (the icon tile's expanding ring and the breathing dot, registered 2026-11-11), is registered in DESIGN.md §14.4 「macOS menu bar quota fill」. Available on macOS 14+ and toggled in Settings → Window behavior (default on).
  • The panel uses the system popover material (NSVisualEffectView, .popover) with a 0.5pt hairline edge, so it follows the desktop wallpaper and Light/Dark automatically. Over the material it lays a warm tint (Light #F8F7F3 at 50%, Dark #1A1918 at 54%; owner corrections, 2026-10-16: 72%/74% was noticeably more solid than the plain material, 22%/26% let busy wallpapers wash out gray text and made the tiles read as pasted-on boxes) and a faint Heart Orange glow in the top-left corner, so the panel reads in Cindy's warm neutrals instead of the cool system gray (owner-approved B2 direction, 2026-10-16). Because the panel is translucent, every neutral — text, outlines, hairlines, tiles, the glass wells, the liquid and neutral ring arcs — is Cindy's warm black #26221C (Light) or warm white #F2EFE9 (Dark) at an opacity, never a fixed gray, so its contrast tracks whatever shows through instead of drifting (owner decision, 2026-10-16): primary text 92% / 94%, secondary 60% / 62%, tertiary 42% / 42%, outlines 14% / 13%, hairlines 8% / 7%, faint fills and ring tracks 5% / 5%; tiles are white 45% / warm white 5%; wells white 70%→50% / warm white 7%→2.5%. Solid colors are reserved for state (warning, error), brand (logo red), Agent/harness identity (including the Codex blue and Claude orange detail rings, kept by owner decision 2026-10-16) and the primary pill fill (#1F1E1C / #F2EFE9), which must read at full contrast. Native SwiftUI controls (segmented Picker, Toggle, Swift Charts) are used as-is; their system geometry is not restyled to Web tokens. A segmented control is used only where its labels fit in every language (see below).
  • The menu bar icon uses a fixed Light/Dark image pair with template tinting disabled (owner-approved hair and earring refinement, 2026-10-18). Its silhouette stays flat and 100% opaque: pure black in Light, pure white in Dark. Four irregular, tapered hair strands add gray detail over that silhouette (#BDBDBD in Light / #686868 in Dark, at 58%, 48%, 36% and 52%); these are tonal overlays, not transparent cutouts or whole-character shading. The > earring cutout is larger and shifted slightly left. The native status button's effective appearance selects the image, since the wallpaper can make the menu bar differ from the app; the settings preview uses the same pair. These fixed grays belong only to this native brand asset. Provider/harness logos remain template images (monochrome, tinted by the system). Brand red (logo red #F70121) appears only in the Cindy wordmark, a fixed Light/Dark image pair, and in the logo's > mark that leads the footer "Open Cindy" pill (owner request, 2026-10-16); it is never used for state.
  • Status colors are fixed native values shared by both appearances and follow the shared quota rule (owner decision 2026-10-31, replacing "15% / used up"): yellow #F3A115 (30% or less left) and red #EF4444 (10% or less left). Agent/harness fills reuse the identity colors of the §2 Usage History registration: --engine-badge-cc #D97757 (with two lighter steps for Claude's session/per-model rings), --engine-badge-codex #7A9DFF and --usage-model-1 teal for Pi; neutral ink fills carry no state.
  • Usage tubes are glass wells holding a translucent liquid instead of solid paint (owner correction, 2026-10-16: the opaque gray read as dirty): one flat tone with no gradient — warm black #26221C at 46% (Light) or warm white #F2EFE9 at 72% (Dark) — so the well shows through and each appearance stays clean; deliberately lower contrast than the text so seven full tubes do not read as hard black or white bars. Neutral ring arcs (Grok, a balance) use the same warm black 42% / warm white 80%; a yellow or red liquid is flat #F3A115 / #EF4444 with a still glow under the tube. The recommended tube gets a 1pt secondary-gray outline (owner decision, 2026-10-16: the earlier 1.5pt ink outline read as a selection or an error once the liquid was softened) and nothing else — no halo and no logo tile before the headline (owner decision, 2026-10-16: the headline already names the source). The warning glow does not animate. The liquid's top corners are softly rounded (4pt, less for a very low level) so the surface does not read as a hard flat line (owner request, 2026-11-01): on the Mac panel the corner follows the surface while it ripples or sloshes, and the iPhone and Android widgets use the same 4pt. A 7pt warning dot precedes the second headline line when that line is about sources running low or resetting (main sends headlineAlert).
  • Numbers use Barlow Condensed (OFL, shipped next to the helper): tube values and their % sign (the sign at about 60% of the value, same baseline), reset times, task amounts and shares, the task total, the month total, the detail ring value, and the usage page total and harness amounts. The detail page's fact-card values ("62,500", "周四 14:13") stay in the system font (owner correction, 2026-10-16): they are content, often mixing words, not metrics. Only pure numbers take Barlow (digits, money and % signs, and unit letters straight after a digit: "53", "$31.17", "12.5k", "98%"); any string that mixes in Chinese or words ("15天12时后重置", "周四 14:13", "5d 11h") stays entirely in the system font, because a condensed face beside Chinese reads uneven (owner correction, 2026-10-16). Two-line rows align the amount to the title's baseline and the share to the meta line's. If the font files are missing the helper falls back to a smaller system font.
  • Separators inside the panel are a single 0.5pt hairline in the soft line color (Light #26221C at 8%, Dark white at 7%); a system Divider is not used because it draws its own darker separator under any overlay (owner correction, 2026-10-16).
  • Copy is truthful: the headline recommends the source with the most room ("{{name}} has the most left.") without promising a task's routing destination.
  • Subscription pools (issue #10110): each unpaused account has its own tube, with identity, plan, windows and balance from that account's snapshot. Signed-out or unavailable accounts do not borrow the CLI default's quota; an unused default slot stays hidden. Migrated provider aliases do not create extra tubes. Duplicate local and peer accounts share one source only when their account identity is sufficient: a Codex email alone does not identify a ChatGPT workspace, so pooled readings without a workspace ID remain separate. Matching percentages never identify pooled accounts. The local running marker comes from that account's running count. Codex reset credits remain exclusive to the default account. A pooled account's new-task action names the provider, since dispatch still belongs to the pool. Peer account labels follow the existing privacy masking. When pooled short names collide (including after masking), prefix the plan; matching or missing plans use a source-ID-ordered ordinal without exposing the ID. This keeps the distinguishing part visible in narrow tubes and uses the same name in recommendations, management rows and phone widgets. Phone widgets reuse this projection. Manual refresh bypasses the local pool's quota cache while coalescing concurrent reads; an older in-flight cached read finishes before one fresh read. Legacy Codex defaults keep their plan from the same profile's native quota response. Pool account metadata takes precedence for the plan; if it is missing or blank, preserve the plan derived from that same account's usage snapshot. Implementation and regressions: menubar/collect.ts, quota-overview/service.ts, subscription-accounts/runtime.ts, nativeCli.ts and their tests. No native layout or appearance changes are needed.
  • Every subscription tube shows its weekly window: value, fill, countdown, the headline and low warnings all read it, so accounts compare on one scale and a 5-hour window that has not started (no reset time yet) never blanks the countdown (owner decision, 2026-10-31). An exhausted 5-hour window is therefore visible only in the detail page, which still lists every window. Accounts without a weekly window fall back to their tightest window.
  • Size and density (owner request, 2026-10-12: lighter on small laptops, verified in every language): every page is 320–368pt wide by tube count, with a 20pt panel radius and 14pt tile radius. The panel never takes more than 86% of the screen's visible height; longer content scrolls between the fixed header and footer. When the visible height is under 1000pt (13–14" laptops at default scaling), the panel opens in a short layout: 82pt tubes instead of 104pt, 160pt rings instead of 188pt, and two task rows instead of three.
  • The usage page (owner-approved redesign, 2026-10-12) shares the panel width and slides in like a detail page instead of widening into a dashboard. Top to bottom it shows: back, title and a 7/30/90-day switch; one total with two caption lines (period, scope and value basis; daily average, paid and tokens); a 100pt stacked chart labeled only with its first day and Today, where hovering a day swaps the total for that day's amount and harness split; a thin harness bar with share and amount per harness; the top five models or today's tasks; and the value note. There is no amount/tokens switch and no scope switch: the scope follows Settings, and the caption names it.
  • Every row must fit in the longest supported language. A segmented control is used only where all its labels fit on one row in every language. The four menu bar text options are a two-column chip grid. Other controls fall back instead of overflowing: the usage-scope picker moves under its title. Screenshots for review cover English, Simplified and Traditional Chinese, Japanese and Korean, in Light and Dark.
  • Keep the main panel's original order: model quota first, tasks second, then the usage chart (owner correction, 2026-10-26). The task section uses three quiet text tabs: Unread, In progress and Today's usage. These are deliberately frameless, with no filled segment track; ink emphasis and a short underline identify selection. Each keeps a 28pt hit height and native keyboard/selected accessibility. Opening with attention selects Unread; otherwise it restores the last manually selected non-unread tab for this helper lifetime. Before any manual choice, prefer In progress when work exists, otherwise Today's usage. Updates never switch an already-open panel, including when the last unread item clears. Opening or switching tabs never acknowledges messages.
  • Unread and In progress reuse the island's full candidate projection before current-card clipping, including remote tasks and restored companion chats. Unread counts the exact attention candidates; In progress includes running and waiting-for-input tasks. Preserve the island's candidate order: waiting items come first in In progress, then the latest user/scheduler prompt; agent output and tool progress never reorder running rows (owner correction, 2026-10-27). Rows show identity, a single-line message/status preview with tail truncation, and time; no full-content hover tooltip (owner correction, 2026-10-27). Privacy mode masks both identity and preview. Clicking uses the island's existing device-aware navigation and read acknowledgement. Two rows on short screens, otherwise three, with an in-place All tasks / Collapse action; usage keeps its existing money ranking and usage-page link.

本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 cind/cindy