Add the advanced search drawer, adaptive paging, and zoom

This commit is contained in:
Fisto
2026-09-17 07:57:26 +02:00
parent dea1724eb3
commit 5319a028e2
9 changed files with 492 additions and 159 deletions
+4 -4
View File
@@ -23,10 +23,10 @@ interface MediaService {
}
```
`MediaQuery` (implemented): `kind`, `source`, `scrapeId`, `channelId`, `authorId`, `aspect`,
`resolution`, `after`, `before`, `limit`, `offset`. The `aspect` and `resolution` values are the
preset keys from `filter-presets.ts`; `after`/`before` are ISO times on `posted_at`. Planned:
`guildId`, `text`.
`MediaQuery` (implemented): `kind`, `source`, `scrapeId`, `channelId`, `authorIds`, `origin`
(`guild`/`dm`), `cachedOnly`, `aspect`, `resolution`, `after`, `before`, `limit`, `offset`. The
`aspect` and `resolution` values are the preset keys from `filter-presets.ts`; `after`/`before` are
ISO times on `posted_at`. Planned: `guildId`, `text`.
`StorageStatus`: `usedBytes`, `limitBytes`, `warnPercent`, `overrunPercent`, `byKind`,
`scrapes: [{ id, bytes, state, createdAt }]`.
+12 -5
View File
@@ -126,10 +126,17 @@ box live in Chat, not Call, and the connection stats are not chips yet.
is visible, stay on screen). Settings slides over the media view, and dialogs that Settings
opens (for example **Clean media…**) render above Settings. Mobile is out of scope for the media
feature.
- Media lists scraped items with kind chips (All, Images, GIFs, Videos, Audio) and filters for
source (any, attachments, stickers, embeds), source channel, poster, aspect ratio, resolution,
and a posted-date range (from/to). **New scrape…** opens a popup with **Server** and **Group
chat** tabs: servers expand into their text channels, each channel (and each group chat) has
- Media lists scraped items. Filters live in an **Advanced search** drawer and do not apply until
**Apply filters** is pressed: filetype chips, source kind (attachments/stickers/embeds), origin
(server channels or DMs), a multi-select **People** list, and an **Advanced** section with aspect
ratio, resolution, source channel, posted-date range, and **Show only cached previews**.
**Reset** clears every filter and the zoom, unloads the grid, and brings back the initial
Load media prompt.
- A **Card size** slider scales tiles from two-thirds of the old size up to one image per row; the
page size follows the layout — full rows about 1.5 screens tall — and the grid infinite-scrolls,
preloading the next page's JSON and preview images just before they are needed.
**New scrape…** opens a popup with **Server** and **Group chat**
tabs: servers expand into their text channels, each channel (and each group chat) has
**Links** and **Download** buttons, and group chats always use the puppet. **History** lists
each scrape with start time, duration, pages, messages, media counts, bytes, files, and previews.
The scrape strip shows live progress with a pulse and **Stop**. Images and GIFs render from the
@@ -258,7 +265,7 @@ replaceable.
| POST | `/api/audio/stop` | none | Stop speech and clear the queue |
| POST | `/api/audio/capture` | `start` | Start or stop capture |
| GET | `/api/transcript` | `limit?`, `sessionId?` | Sessions and captured segments |
| GET | `/api/media` | `kind?`, `source?`, `channelId?`, `authorId?`, `aspect?`, `resolution?`, `after?`, `before?`, `limit?`, `offset?` | Media items across every scrape, newest first. `source` is `attachment`, `sticker`, or `embed`; `aspect` and `resolution` are the preset keys; `after`/`before` are ISO times on `posted_at`. Items carry `authorName`, `postedAt`, `width`, `height`, `aspectRatio`, `contentType`, `durationSecs`, `previewError`; `localUrl`/`thumbUrl` when a file or preview exists |
| GET | `/api/media` | `kind?`, `source?`, `channelId?`, `authorId?` (comma list), `origin?` (`guild`/`dm`), `cachedOnly?`, `aspect?`, `resolution?`, `after?`, `before?`, `limit?`, `offset?` | Media items across every scrape, newest first. `source` is `attachment`, `sticker`, or `embed`; `aspect` and `resolution` are the preset keys; `after`/`before` are ISO times on `posted_at`. Items carry `authorName`, `postedAt`, `width`, `height`, `aspectRatio`, `contentType`, `durationSecs`, `previewError`, `animUrl`; `localUrl`/`thumbUrl` when a file or preview exists |
| GET | `/api/media/:scrapeId/:itemId/file` | none | The downloaded file, content-typed from its extension |
| GET | `/api/media/:scrapeId/:itemId/thumb` | none | The cached preview (type from `preview_ext`) |
| GET | `/api/media/:scrapeId/:itemId/stream` | none | Playback/full-view source: the local file, or the remote URL refreshed from the source message. Supports `Range`. Non-media upstream responses (provider pages) return `415` |