Say how long the read has left, and let it be stopped - #38
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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 left→8s left→5s 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 —
analyseMotiontakes anAbortSignaland 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:
251 unit tests, 81 browser tests (was 77), build clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ux1kydvUkLRoMbHp82ofDi
Generated by Claude Code