Skip to content

feat(summary): Gemini summary panel on the dashboard (F-15) - #47

Merged
TahubCS merged 3 commits into
mainfrom
feat/gemini-summary
Oct 11, 2026
Merged

TahubCS merged 3 commits into
mainfrom
feat/gemini-summary

Conversation

@TahubCS

@TahubCS TahubCS commented Oct 11, 2026

Copy link
Copy Markdown
Owner

What

Adds F-15 (ADR-045, ADR-068 Proposed): a "Where you stand" panel on the dashboard, under the headline.

  • Opens with a summary and up to three suggestions built by code. No model call on page load.
  • "Write it with Gemini" makes one model call. Gemini is sent label names and preset category names only: no amount, account nickname or payment name.
  • Every sentence Gemini writes passes the same check as a text reply (digit scan, known labels only, "a month" / "this month" / "a year" rules). One failing sentence rejects the whole answer and the code-built panel stays, with a line saying Gemini did not answer.
  • Five requests a day for each person, across workspaces, counted under a per-person lock. Past five, no model is called.
  • What Gemini wrote is kept for the rest of the day in label form and filled with current figures on each page load, so it cannot disagree with the headline. Amounts are never stored.
  • The panel says who wrote it, when, and how many requests are left today.

How

  • New feature src/features/summary/ (domain, server, ui).
  • Reuses the agent's brain: getSummary, and a new src/features/agent/client.ts with the pure parts. The texting instruction is byte-identical to before (checked by hash).
  • Two new labels, also available to texts: subscription_yearly and over_budget_count.
  • generateLongText in src/lib/ai/client.ts: the same chain with 8 seconds for each model.
  • CashflowDashboard takes one optional summaryPanel prop.

Schema change

Migration 0019_summary_write is included: one row for each request (workspace, person, day, draft in label form). It is applied to the local Docker database only. Run pnpm db:migrate:to branch and production before deploying.

Tests

  • Vitest: panel check, code-built panel, request contents, limit, simultaneous clicks, next-day reset, stored draft refilled with new figures, workspace isolation; both entry points are in the isolation matrix.
  • Playwright: tests/e2e/summary.spec.ts (5 tests).
  • pnpm test:unit before merging main: 2628 pass; 8 fail, all statement-storage tests that need .env.storage-tests.
  • Tried against the real test model with made-up figures: drafts passed the checks.

Not verified

  • Full unit and e2e suites after merging main.
  • A browser click with a real Gemini key, and the deployed users' models.

Open problems

  • A request that got no answer still uses one of the five.
  • A stored summary's wording can go out of date within the day; only its figures are refreshed.
  • ADR-068 needs Muhammad's confirmation.

Docs

ADR-068, PROJECT (F-15), ARCHITECTURE (ARCH-03, ARCH-07), PITCH (1:10 demo step), AGENTS.md, HANDOFF (HO-121, HO-120).

🤖 Generated with Claude Code

TahubCS and others added 3 commits October 11, 2026 09:45
… the day (F-15)

Adds summary_write (migration 0019): one row per request. Each person may
ask five times a day; the draft is stored in label form and filled with
current figures on each page load that day (ADR-068).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps both sides in AGENTS.md, the isolation matrix and HANDOFF. Main took
HO-119, so the summary panel's first entry is renumbered HO-121. The
screenshots are main's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
reeflect Ready Ready Preview Oct 11, 2026 2:00pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: TahubCS/Reeflect/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 69c3ea26-04db-4f9f-b2ba-5ed5300c6d3f

  • 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

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T14:04:25.797740Z d491873 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.

@TahubCS
TahubCS merged commit 794caab into main Oct 11, 2026
8 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d491873359

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/DECISIONS.md
Comment on lines +2041 to +2042
- **Status:** Proposed (2026-10-11)
- **Owner to confirm:** Muhammad Tahub Khatri

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Confirm the proposed schema decision before merging

This commit adds migration 0019 and the summary_write schema while its governing ADR is still explicitly Proposed and awaiting owner confirmation. Repository policy requires confirmation before starting an expensive-to-reverse database-schema change under a Proposed ADR, so obtain and record that confirmation before this change proceeds.

AGENTS.md reference: AGENTS.md:L83-L87

Useful? React with 👍 / 👎.

Comment on lines +413 to +415
const overBudget = asked.categories.filter(
(category) => category.budget === "over",
).length;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Count over-budget categories before truncating

asked.categories comes from monthFacts, which truncates the budget rows to 12 before this count. A workspace can have more than 12 spending categories, including 15 built-in presets, so if an over-budget category sorts below the cutoff this label under-reports the total or disappears entirely, and the panel can tell the user the wrong number of categories are past budget. Compute this count from the full month.categories collection while retaining the 12-category cap only for model-facing details.

Useful? React with 👍 / 👎.

This branch was successfully deployed

1 active deployment
Preview — d4918733 Deployed Oct 11, 2026 by vercel[bot]
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.

2 participants