Skip to content

feat(dashboard): token activity, command logos, Settings page and GitHub link chips - #439

Merged
Brooooooklyn merged 5 commits into
mainfrom
feat/token-activity
Nov 29, 2026
Merged

Brooooooklyn merged 5 commits into
mainfrom
feat/token-activity

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Contributor

Summary

  1. Token activity on the Overview

    • A new panel after the Engine / Health row: five tiles (lifetime tokens, peak day, longest turn, longest streak, current streak) and the last 53 weeks as the Arc Pro activity terrain (arc-x/activity-terrain/). Top view by default, perspective on a switch; Daily / Weekly / Cumulative views; a hidden week table for screen readers.
    • Tokens = cached + new input + output, all outcomes. Days and streaks use local days; weeks start on Monday.
    • Host: GET /api/metrics/token-activity on the DB worker. Per-day totals are cached in worker memory, and later calls read only the new trace rows (about 0.5 s cold at 1M rows, about 4 ms warm). A delete triggers a full rescan.
    • Traces are kept forever: the 30-day prune is removed (src/ingest/traces.ts, src/worker/engine.ts). The cache trend keeps its own 30-day window (CACHE_TREND_WINDOW_DAYS).
    • "Today" moves at local midnight with no turn: a self-rearming timer (date read again at least every 10 min, so sleep and clock or time zone changes are caught), a 1-minute retry while the answer's today is behind, and RefreshAlert when a refresh fails over cached data.
  2. Program and provider logos

    • "Ran" rows show the real mark of the program: gh, firecrawl, git, npm, docker, cargo, vite, vite+, vitest, oxlint / oxfmt / oxnode, bun, xcode, python / python3. A hand-written scanner skips env assignments, env / sudo / time and cd … && (ui/src/lib/command-program.ts).
    • Provider cards show Exa, DeepSeek, Brave and Firecrawl marks.
    • Marks are inline SVG from official sources (arc-x/brand-mark/brand-paths.ts). A brand color is used only where it passes 3:1 contrast in both themes; otherwise currentColor.
  3. Settings page (/settings, last in the Manage section of the nav, ⌘,)

    • Appearance: theme, model colors, fonts (moved from the footer popover and /fonts, which are removed).
    • Coding: the gh sign-in status (signed in, signed out, not installed, outdated, error) with Recheck, and the "Claude Code in Work" switch.
    • Data: the data paths from the old popover.
    • Coding agents is hidden for now: no nav item, palette entry, ⌘ key or onboarding button. Its page, host routes and tests stay. Onboarding ends with "Start a chat".
  4. GitHub link chips in conversations

    • Sent user messages and assistant links/autolinks draw a chip for github.com pull requests, issues, commits (/commit/<sha> and /pull/N/commits/<sha>) and repository security advisories (/security/advisories/GHSA-…).
    • Rich by default: state icon and title from the gh CLI. Parse-only (owner/repo#91 with a neutral icon) when gh is not signed in or returns an error.
    • The sign-in state is cached 30 minutes (1 minute after an error). Recheck bypasses it. A sign-out or a login change empties the link cache.
    • gh runs on the transport thread like work-git.ts runBin: no shell, stdin closed, a deadline, a clean env with the login-shell PATH and no GH_TOKEN. At most 4 at once. Only owner/repo and a number, sha or GHSA id reach an argument, each checked by a hand-written scanner. Nothing is written to disk.
    • Chips keep the line height (ExpandableText measures lines) and keep the link rule of their place (lib/link-rule.ts).
chip mounts ─▶ page store (50 ms batch, ≤12 keys, ≤2 in flight)
                   │  GET /api/github/refs?ref=…
                   ▼
            GithubService (transport thread)
              auth: gh --version + gh auth status --json (30 min)
              refs: gh api --method GET repos/{o}/{r}/(issues|commits|security-advisories)/{id}
                   │  signed in → { kind, status, title }   else → null (parse-only)
                   ▼
            chip upgrades in place (no width animation)

Verification

  • yarn typecheck, vp check in packages/dashboard (917 files formatted, 788 files with no lint or type errors)
  • vp test packages/dashboard/__test__ --run: all active test files pass, including pack.test.ts after build:ui
  • New host tests: token-activity-rules, github-ref (argument scanner), github-parse (recorded gh 2.105.0 outputs), github-service (auth cache, Recheck, sign-out and login-switch cache clears, TTLs, dedupe, limiter, queue, fallbacks), github-routes (type seam and handler output). Mutation-checked.
  • Live read-only gh api GETs on this machine for a PR, an issue, a commit (including a fork PR commit), a published and an unpublished advisory, and 404s.
  • Adversarial review (Codex) on both halves; every finding verified, then fixed.
  • The branch build is installed as the local Portato app.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: acaf5d6e-6a19-43aa-9bc4-d833d5e6070a

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T07:07:16.718499Z 9722027 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Brooooooklyn and others added 5 commits November 29, 2026 17:17
…Hub link chips

- Overview: token activity over 53 weeks (Arc Pro activity terrain, top view by
  default) with five lifetime tiles, served from a per-day cache on the DB
  worker (`GET /api/metrics/token-activity`). Traces are kept forever: the
  30-day prune is removed; cache stats keep a 30-day trend window.
- Ran rows and provider cards show real program and provider logos (gh,
  firecrawl, git, npm, docker, cargo, vite, vite+, vitest, oxc tools, bun,
  xcode, python, exa, deepseek, brave).
- Settings page in the nav (and ⌘,): Appearance (theme, model colors, fonts),
  Coding (gh sign-in status with Recheck, Claude Code in Work), Data. The
  footer popover and /fonts are removed. Coding agents is hidden for now.
- GitHub link chips in conversations: pull requests, issues, commits (also
  /pull/N/commits/<sha>) and repository security advisories. Rich from the gh
  CLI when signed in (auth state cached 30 min), parse-only when signed out or
  when gh fails. gh runs on the transport thread with a clean env and
  scanner-checked arguments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…gine row

- LiveDot: the shimmer label's clipping inline block hung a descender's height
  under the line, so the dot sat low; it now hangs from the line top, and a
  labelled dot sits on the x-height middle (0.00 px measured, shimmer on/off,
  sizes 6 and 8).
- Overview Engine row: one shared text baseline; an idle engine shows a muted
  0 tok/s instead of a hero-size dash; the empty activity strip's zero line
  uses the border color.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The row already shows the state: the muted rate, the strip's phase bands,
"N in flight · N queued", the idle or lanes line under it, and the status row
above. The Engine page keeps its badge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Labels start with a capital, so a dot on the x-height middle reads low. The
dot now centers on 0.5cap above the baseline (about 1 px higher at 13 px).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-back read

The queue row is written after the reply and the give-back writes nothing, so
the final read raced the enqueue write on a loaded runner (CI: expected [] to
deeply equal ['second']). Forced 50 ms write delay: 10/10 fail before, 0/10
after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Brooooooklyn
Brooooooklyn enabled auto-merge (squash) November 29, 2026 09:17
@Brooooooklyn
Brooooooklyn merged commit 06a4443 into main Nov 29, 2026
21 checks passed
@Brooooooklyn
Brooooooklyn deleted the feat/token-activity branch November 29, 2026 09:56
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