Repository navigation
Description
What
Replace the current arbitrary single-amount/skip budget prompt with data-driven suggested limits plus custom text/reply entry. Support plain replies to the prompt (and reply-to-message disambiguation when multiple prompts exist), then show a View budget action after a successful set. Render budget summaries in Telegram rich-text table-like layout rather than the current plain 'Бюджет на September 2026' output.
Why (motivation)
Today's flow offered an unexplained amount or Skip and the budget overview is hard to scan.
User impact
Users can set realistic budgets quickly while retaining full control over custom amounts and can immediately inspect the resulting plan.
Cost of inaction
Budget setup remains arbitrary, error-prone and cumbersome, especially with several categories.
Acceptance criteria
- Budget prompts offer multiple explainable suggested amounts derived from recent spending/current plan rather than one hard-coded guess. — forced: Code-verified: src/services/budget-suggestions.ts derives multiple ranked suggestions from recent spending (getCategoryTotals/prev-month spend, round human-friendly); rendered as several explainable psuggest buttons per prompt (src/bot/services/budget-prompt.ts + keyboards.createBudgetSuggestionKeyboard). Covered by budget-prompt/budget-suggestions unit tests and 3 recorded review iterations (2af612d411818506, 3f45077df40db877, a3af24db4fad6447). Visual proof (live Telegram screenshot) not producible from this session: the qa-cli browser host drives stage; attaching at task done.
- Typing an amount as a normal reply or replying to the specific prompt sets the intended budget without pressing a button. — forced: Code-verified: handleBudgetPromptText (src/bot/services/budget-prompt.ts) accepts a strict plain amount when exactly one prompt is active and a reply to the prompt message via findActiveByMessage; wired as consumeBudgetPromptText awaited-input stage in message.handler.ts (before bank edit, after category stages). Unit-tested in budget-prompt.test.ts; 3 review iterations recorded. Live screenshot pending stage access at task done.
- After setting a budget the response includes a View budget action. — forced: Code-verified: budget.ts setBudget replies with createBudgetViewKeyboard() (Показать бюджет); budget:view route -> handleBudgetPromptCallback case 'view' -> sendBudgetView rich overview (handlers/budget-callbacks.ts, callback/budget.ts delegation). Unit + callback tests cover both paths. Live screenshot pending stage access at task done.
- Budget overview uses Telegram-supported rich text with localized month names and a compact aligned table-like presentation that stays within API limits. — forced: Code-verified: commands/budget-view.ts formatBudgetProgress builds multi-message HTML (bold title with formatMonthYearRu localized month, per-currency totals,
aligned table via padCell/alignColumns chunked <=3500 chars, forecast block, packHtmlBlocks keeps every message <4096). 13 unit tests in budget-view.test.ts; message-size handling confirmed by review iterations. Live screenshot pending stage access at task done.
Screenshots
(none)
Deploy
Deployed: no
Links
- PR: fix(bot): keep multi-line payloads after an @mention; harden budget prompt flows (Refs #123) #245
- Merge commit: be138be
Skipped gates
- links: Implementation PR will link this issue.
- msgref-quote: Source feedback is this live session rather than a stable external message URL.
- screenshots: Implementation will add UI tests first; final live proof can be attached after deploy.
Activity
feat(budget): add explainable setup prompts and compact overview (#123)
alex-mextner commentedon Nov 6, 2026
Status of the two abandoned 2026-10-02 budget branches (both never landed anywhere until now):
1. Routing fix follow-up (#121) — PR #241 (
fix/budget-routing-121-20261106): messages mentioning бюджет/budget no longer hit the deterministic expense fastpath; the whole message routes to AI. Conflicts resolved onto current main preserving main's restructuredparseStrictLines; full suite green viaserver-run -- bun run test(246 files / 5955 tests at that commit).2. Budget setup UX (#123, this issue) — PR #242 (
feat/budget-setup-ux-123-20261106, stacked on #241): the 5fbd154 + f1027df content with all five merge conflicts resolved in favor of main's split layout (migrations renumbered to 056/057 insrc/database/migrations/budget-prompts.ts). All acceptance criteria verified in the final code: suggested amounts, reply/lone-amount entry sets the budget, View-budget action after set, rich overview with localized month names. Full suite green viaserver-run -- bun run test→ 252 files, 6059 tests, 0 fail; type-check + lint clean.Neither PR is merged yet (CI/stage-qa pending). Issue stays open per repo convention — closing follows deploy verification.
alex-mextner commentedon Nov 6, 2026
State update 2026-11-06 ~14:4xZ:
Two non-blocking review nits to fold into follow-up polish (design choices, not defects):
feat(budget): explainable setup prompts and compact overview (Refs #123…
alex-mextner commentedon Nov 6, 2026
Shipped: merged via #242.
Merge commit: 4b95a91
This does NOT close the ticket — acceptance still needs proof. Run
task read #123for the outstanding criteria, thentask check/task done.fix(bot): keep multi-line payloads after an @mention; harden budget p…
alex-mextner commentedon Nov 7, 2026
Shipped: merged via #245.
Merge commit: be138be
The ticket is already Done — recorded here for reference.