Budgets and periods in the Mini App
  • Tanga
  • Mini App
  • Testlar
  • UX

Budgets and periods in the Mini App

83
Two requests came together: budget limits set in the bot with /byudjet should be visible in the Mini App, and income and expenses should be viewable by period. The budget card shows each category's spending against its limit, what is left or how far it is over, and how much can be spent per day until the end of the month. It turns amber at 80% and red at 100%, and uses exactly the same calculation as the bot, including dollar expenses converted at that day's rate. The Transactions tab got day, week, month, year and a custom range, with arrows for the previous and next period. For any period it shows income, expenses, the difference and the average daily spend, plus categories with their share — tapping one filters the list. The Analysis tab can now step back through past weeks, months and years, and for a past month the insights no longer say "this month". Testing was the interesting part. The Mini App only opens inside Telegram, with signed data. I ran a local copy with a stub that signs test data, and the page's security policy blocked my inline script — rightly — so the stub became a separate file. Headless Chrome still drew a desktop-wide page, so I drove it through the DevTools protocol with real phone emulation. Takeaway: test it the way the user sees it — on a phone, in their language, on their plan.