mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
feat(tg): premium Mini App cockpit — spend hero, charts, avatars (#582)
* feat(tg): premium Today — spend hero, trend, quick actions, fleet avatars The cockpit home stops being flat cards and becomes a real app surface: - Spend HERO: the day's cost at 40px with a signed delta-vs-yesterday chip and a live 7-day amber area sparkline (hand-rolled inline SVG, no charting lib in the Mini App bundle). - Quick-action ring: circular Approve (amber + needs-you badge) / Board / Inbox / Chat, the wallet-style primary-verb row. - Needs-you as a rich amber gradient banner (top items + draft chips) instead of a plain section. - Fleet as live avatar tokens (stable per-name hue, pulse dot) over the working list. - "Shipped this week" day-bars (today emphasized) + week total. Backend: /telegram/today gains spend.series (7-day cost) + delta_pct and a velocity series (per-day completed tasks) — two cheap grouped-by-day queries, same DB-only ethos, degrading to zeros on error. * feat(tg): color-code approval rows by kind TgRowIcon gains a tone prop; the approvals list tints each tile per kind (amber Release / sky X post / violet Video / emerald Roadmap) so a mixed queue reads as color-coded instead of a monochrome column. * feat(tg): sender/peer avatars on Inbox + Chat Inbox notifications and Chat conversation rows adopt the fleet-avatar language: a per-name-hued initials token leads each card, unread inbox items carry a subtle primary tint, and both cards move to the rounded-2xl surface — so every tab now shares one visual system. Board keeps the shared MobileTaskBoard (already grouped/pill-styled, and reused outside the cockpit). --------- Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
@@ -34,8 +34,14 @@ function brief(overrides: Record<string, unknown> = {}) {
|
||||
roadmap_items: 0,
|
||||
},
|
||||
},
|
||||
fleet: { total: 3, by_status: { active: 3 }, working: [] },
|
||||
spend: { tokens_today: 1_234_000, cost_today_usd: 12.34 },
|
||||
fleet: { total: 3, by_status: { active: 3, idle: 0 }, working: [] },
|
||||
spend: {
|
||||
tokens_today: 1_234_000,
|
||||
cost_today_usd: 12.34,
|
||||
series: [1, 2, 3, 4, 5, 6, 12.34],
|
||||
delta_pct: 10,
|
||||
},
|
||||
velocity: { series: [1, 2, 0, 3, 1, 4, 2], week_total: 13 },
|
||||
ship: { version: "0.25.0", open_release_proposal: false, ci_fix_tasks: 0 },
|
||||
...overrides,
|
||||
};
|
||||
@@ -65,7 +71,7 @@ describe("TgTodayTab", () => {
|
||||
expect(screen.getByText(/1\.2M tokens/)).toBeInTheDocument();
|
||||
expect(screen.getByText("v0.25.0")).toBeInTheDocument();
|
||||
expect(screen.getByText(/no release pending/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/3 agents/)).toBeInTheDocument();
|
||||
expect(screen.getByText(/3 active/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders needs-you items and deep-links taps into the right tab", async () => {
|
||||
|
||||
Reference in New Issue
Block a user