Skip to content

Say how long the read has left, and let it be stopped - #38

Merged
ibrahimweng merged 1 commit into
mainfrom
claude/stop-the-read
Aug 31, 2026
Merged

Say how long the read has left, and let it be stopped#38
ibrahimweng merged 1 commit into
mainfrom
claude/stop-the-read

Conversation

@ibrahimweng

Copy link
Copy Markdown
Owner

Reading a video is the longest wait in the app. The button that starts it was also the button that showed the progress, and it greyed itself out for the duration — so there was no way to know how much longer and no way out. Loading the wrong file meant waiting it out or reloading the page.

The wait itself is not the fault

The obvious fix is to make it faster, so I measured that first. Sampling rate against moments found, on a dense thirty second clip with forty events in it:

samples per second moments found
15 (current) 40 of 40
10 37
8 33
7 31
5 21

Going twice as fast halves the wait and loses nine of forty. The rate is paid once per clip and the miss is paid every time somebody looks for a moment that is not there, so the existing choice is the right one and it is left alone.

What changed

The button counts down. Reading · 10s left8s left5s left, worked out from the rate so far rather than guessed. A percentage answers a question nobody has; the one somebody does have is whether to wait or go and do something else. It says nothing until a twentieth of the way in, because before that the rate is mostly the cost of starting and the answer swings about by minutes. Rounded up to whole seconds, and to minutes past ninety.

It stays live, because it is the way to stop. Pressing it again calls the read off. The abort reaches the frame loop, not just the state — analyseMotion takes an AbortSignal and resolves rather than throws, since "I have changed my mind" and "this file cannot be read" are not the same thing to say to somebody.

Stopping keeps nothing. A pass over the first third of a clip would suggest sounds for the first third and say nothing about the rest, which reads as the app having found nothing there.

Checking

Four browser tests, each checked by putting its fault back:

  • dropping the countdown fails one
  • leaving the button disabled fails one
  • removing the abort from the frame loop fails one — and this is the one worth naming. The first version of that test passed with the abort taken out, because the orphaned read finished after the assertions had run. Resetting what is on screen is not stopping: a read that was only forgotten about carries on and hands its results in half a minute later, so moments appear out of nowhere long after somebody pressed stop. The test now waits past the point the whole clip would have been read.

251 unit tests, 81 browser tests (was 77), build clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ux1kydvUkLRoMbHp82ofDi


Generated by Claude Code

Reading a video is the longest wait in the app — about half the length of
the clip, so a ten minute video is five minutes. The button that starts it
was the button that showed the progress, and it greyed itself out for the
duration: no way to know how much longer, and no way out. Loading the wrong
file meant waiting it out or reloading the page.

The wait itself is not the fault. Sampling half as often halves it and
finds nine fewer of forty moments on a dense clip, measured before touching
anything, so the rate is left where it is.

What changed is everything around it. The button counts down in seconds
rather than up in percent, worked out from the rate so far rather than
guessed, because the question somebody has is whether to wait or go and do
something else. It stays live while it works, because pressing it again is
the way to stop.

Stopping keeps nothing. A pass over the first third of a clip would suggest
sounds for the first third and say nothing about the rest, which reads as
the app having found nothing there.

Four browser tests, each checked by putting the fault back: without the
abort reaching the frame loop the read carries on in the background and
hands its results in half a minute after stop was pressed, which is worse
than not having stopped at all — the test waits past that point.

251 unit tests, 81 browser tests, build clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ux1kydvUkLRoMbHp82ofDi
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
beat-studio Ready Ready Preview Aug 31, 2026 12:18am

@ibrahimweng
ibrahimweng merged commit cbea29b into main Aug 31, 2026
5 checks passed
@ibrahimweng
ibrahimweng deleted the claude/stop-the-read branch August 31, 2026 00:38
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