Phase 2: command screens

- /help: a short introduction with the user's default format, how to be
  asked every time and the limits on one line, plus buttons Commands,
  Account, Groups, Open app and Upgrade that switch the same message to
  a section. Group commands are hidden in private chats; "Add me to a
  group" takes their place.
- /quality: Ask every time, Best that fits my limit, Best, 1080p, 720p,
  480p and Audio only, with the active one checked. Free users see which
  qualities may go over their limit.
- /history: pages of five compact buttons (site, title, format, when),
  a view per download with Send again, Thumbnail, Remove from history,
  and Clear history with a confirmation. Thumbnails are grouped under
  their video. Migration 00007 stores extractor, title, uploader and
  profile on deliveries and adds a hidden flag.
- docs/SCREENS.md shows every screen in en, es and nl, generated by the
  language test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Michilis
2026-11-18 20:46:13 +00:00
co-authored by Claude Opus 5.5
parent 6843053582
commit 123cede7f3
21 changed files with 3758 additions and 183 deletions
+48
View File
@@ -980,3 +980,51 @@ the affiliate program. What was found and planned is in
friends, Open app, and "Add me to a group"
(`https://t.me/<bot>?startgroup=settings`). The bot username comes from
`getMe`.
### Phase 2: command screens
- **/help** is an introduction (how to send a link, the user's default
format and how to switch to "Ask every time", the limits on one line)
with the buttons Commands, Account, Groups, Open app and Upgrade. Each
button edits the same message, and each section has Back. Upgrade is
left out for paying users. In a private chat the Groups section names
no group command; it explains groups and has "Add me to a group". In a
group it lists the group commands. Anyone in a group may switch
sections: the message is help, not a personal setting.
- **/quality** lists Ask every time, Best that fits my limit, Best, 1080p,
720p, 480p and Audio only (MP3), with a check on the active one. A user
who never chose sees "Best that fits my limit" checked, since that is
what they get. Free users see a warning sign on the qualities that a
video as long as their duration limit would push over their size limit.
This uses typical bitrates: Best 6 Mbit/s, 1080p 4.5, 720p 2.5, 480p
1.2, MP3 192 kbit/s. A note explains the sign. Paying users get no
signs.
- **Best that fits my limit.** With no size estimate at all, Best is
picked and the worker's `--max-filesize` guards the real file. The
720p choice means "the best up to 720p", so on a source without a
720p format it is the 480p format and its size.
- **/history rows.** Migration 00007 adds `extractor`, `title`,
`uploader`, `profile` and `hidden` to `deliveries`, the rows history is
built from (they already have `created_at`). The columns are filled
from the job when a delivery is sent, and backfilled for old sent rows
on both databases with correlated subqueries.
- **/history list.** Pages of five. Each download is one button,
"site · title · format · when", for example "Instagram · nasa · 720p ·
today". A generic title becomes the uploader. "When" is today,
yesterday, N days ago, then the date. Site names come from the
extractor; yt-dlp's generic extractor shows the host. The separate
text list is gone; the message only has a header with the count and
page.
- **Thumbnails** are not listed as downloads. Tapping a video shows it
with Send again, Thumbnail (when the source has one), Remove from
history and Back.
- **Removing** from history hides the row and does not delete it, because
deliveries also hold usage and billing facts. Clear history asks first
and hides every row. The Mini App's history follows the same rules.
- Send again from history is a new download through the same path as
every other one, so limits, quota and price apply. A cache hit still
counts as a download.
- **Screens for review.** `docs/SCREENS.md` shows every screen of a
scripted walk through the bot in English, Spanish and Dutch. It is
generated by the language test
(`DLBOT_SCREENS=$PWD/docs/SCREENS.md go test ./internal/app -run TestEveryScreen`).