Skip to content

Show file cards only for files that exist - #99

Merged
Tarquinen merged 2 commits into
devfrom
fix-file-card-check
Nov 16, 2026
Merged

Tarquinen merged 2 commits into
devfrom
fix-file-card-check

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

File cards in the transcript now show only for files that exist, and a bare name finds its file in a subfolder.

Before, any inline code that looked like a file name got a card. A bare name like busy-composer.mp4 was looked up at the session folder root, so its card opened "File Not Found" when the file was somewhere else or nowhere.

  • A video, audio, PDF or document card for a file in the session folder shows only once a 2-byte read finds the file. If it's missing, the name stays as plain inline code, not a link. Other errors (network, 5xx) keep the card, as before. Images work as before
  • A bare name that isn't at the root is looked up with /api/fs/find, keeping only exact name matches. One match opens that file; none or several give no card
  • Files outside the session folder still aren't read up front, since that starts a server instance for their folder. If a tap finds one missing, its card goes away
  • Checks run only for rows on screen, once per file, at most 4 at a time, shared between rows. Missing files are checked again when the session opens or resumes and after each reply, so a file the agent writes later gets its card. A card that arrives after its check grows in with the row

Before and after, from a session-lab reply that names a root video (bare and by an outside path), a missing bare name, a PDF only in docs/, a name two subfolders share, a missing full path inside the folder and a missing one outside it:

Transcript file cards, before and after

Checked on the emulator against session-lab in light and dark, tapping each card and link. Scrolling 40 replies that name 45 files made 45 reads and 43 finds, each for a different file, with at most 4 in flight and none for rows off screen. A file created after the reply got its card on resume, re-checking only the missing files on screen. scripts/check.sh passes for media, transcript and session.

The viewer's pen fix is split out into #100.

A file named in inline code always got a card, even when it wasn't there. A
bare name like `busy-composer.mp4` resolved to the session folder root, so its
card opened "File Not Found" when the file was somewhere else or nowhere.

- A video, audio, PDF or document card for a file in the session folder now
  shows only after a 2-byte read finds the file. If it's missing, the name stays
  plain inline code, with no link and no card. Other errors keep the card.
- A bare name that isn't at the root is looked up with /api/fs/find and kept
  only on an exact name match. One match opens that file; none or several give
  no card.
- Files outside the folder aren't read up front. A tap that finds one missing
  removes its card.
- Checks run only for rows on screen, once per file, at most 4 at a time,
  shared across rows. Missing files are checked again when the session opens or
  resumes and after each reply, so a file the agent writes later gets its card.

Verified on the emulator against a session-lab fixture covering each case, in
light and dark. Scrolling 40 replies made 45 reads and 43 finds, each for a
different file, with at most 4 in flight. scripts/check.sh passes for media,
transcript and session.

The viewer's pen fix is split out into #100.
Tarquinen added a commit that referenced this pull request Nov 16, 2026
The full-screen viewer showed the draw pen on a video that could never load and an empty action bar on a file that didn't load. In a gallery, the "File Not Found" block sat at the left of the screen, and the viewer's status titles had no colour, so they were dark on black in the light theme. The pen now shows on a video only once it has loaded, the action bar is hidden on a file that hasn't loaded, the gallery's file page is centred, and the status titles use the text colour. Split out of #99. Verified: scripts/check.sh :feature:media passes on the VM; checked on the emulator with session-lab in light and dark on a missing video in a gallery, a missing single file, the opening state, a document page, a loaded video and swiping between gallery pages.
- One status() (Found, Missing, Pending) replaces isPending and isMissing,
  which repeated the same guards. shown() is now built on it.
- A semaphore with one coroutine per file replaces the hand-written queue
  (queue, pending, running and pump). Still at most 4 checks at a time, once
  per file, skipped when no row watches the file any more.
- A check now records the folder's generation from when it started. Before,
  a folder invalidated while a check was in flight stamped the stale answer
  with the new generation, so a missing file wasn't checked again. It is now
  checked again straight away.
- The files the viewer found missing are a set, not a map of true.

Verified: scripts/check.sh for media, transcript and session. On the emulator,
this build and the previous commit gave the same cards, the same requests
(45 reads and 43 finds scrolling 40 replies, peak 4 in flight), the same card
for a file created before a resume, and the same removal of an outside file's
card after the viewer couldn't find it. Screenshots matched pixel for pixel
below the status bar.
@Tarquinen
Tarquinen merged commit 81f823a into dev Nov 16, 2026
3 checks passed
@Tarquinen Tarquinen mentioned this pull request Nov 16, 2026

This branch was previously deployed

1 inactive deployment
release — 5214bc9f Deployed Nov 16, 2026 by Tarquinen via check #340
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.

1 participant