Skip to content

feat: add a clip/edit step to the recording flow - #262

Open
anscg wants to merge 6 commits into
hackclub:mainfrom
anscg:feat/lookout-clip-editor
Open

feat: add a clip/edit step to the recording flow#262
anscg wants to merge 6 commits into
hackclub:mainfrom
anscg:feat/lookout-clip-editor

Conversation

@anscg

@anscg anscg commented Aug 9, 2026

Copy link
Copy Markdown

What

Adds a clip/edit step to the recording flow. After you stop recording, the Lookout timelapse editor opens in a Lapse-styled modal so you can trim out parts you don't want before publishing.

How

Bumps the vendored Lookout submodule to 80eb3c6, which ships the TimelapseEditor component and the server-side clips / edit-hold support, then wires it into Lapse:

  • Enable clips on session creation (clips: true in lookout.tscreateSession). Kept explicit rather than relying on the SDK's new default-on behavior, so the editor works even against Lookout deployments that still default clips off.
  • Request the edit hold on stopactions.stop({ edit: true }). Without this the server compiles straight to complete and the session comes back not_ready ("isn't available for editing").
  • Editor popup — after recording ends, TimelapseEditor renders in the existing Lapse Modal; saving or dismissing it continues to the current publish page. No token to edit against falls back to the old straight-to-publish path.
  • Resuming an interrupted edit — if the page refreshes or the browser closes while the edit hold is live, the publish page probes the hold (via the device's stored Lookout token) and reopens the editor instead of waiting out the hold on the compile spinner. Once the hold lapses, the session auto-publishes as recorded (Lookout's lease semantics) and the page proceeds as before. The editor modal is shared between the recorder and the publish page (EditorModal).
  • Accent colour — the SDK's controls and the editor are recoloured to Lapse's red (#ec3750) via the provider's accentColor.

Notes

  • The submodule bump pulls new SDK runtime deps (motion, @number-flow/react, @videojs/react, etc.), hence the pnpm-lock.yaml change.
  • The vendored client's dist is a build artifact regenerated by pnpm dev, so it's not committed.

Testing

  • Server and client tsc --noEmit pass.
  • Vendored @lookout/react builds (JS + DTS) with the editor and accentColor present.
  • Client dev compiles the recorder route against the bumped SDK with no module-resolution errors.
  • Interactive record → stop → edit was validated against the same clip/edit code prior to the upstream merge.

anscg added 2 commits August 10, 2026 03:50
Bumps the vendored Lookout SDK to 1e4fdd7, which ships the timelapse clip
editor and the server-side clips/edit-hold support, and wires it into Lapse:

- Enable clips on session creation (`clips: true`), so the session is
  editable regardless of the Lookout server's default. Kept explicit rather
  than relying on the server default so it works against deployments that
  still default clips off.
- Request the edit hold on stop (`actions.stop({ edit: true })`) so the
  session stays open for editing instead of compiling straight to complete.
- After recording, present the TimelapseEditor in a Lapse-styled modal
  before handing off to the publish page; dismissing or saving continues the
  existing publish flow.
- Recolor the SDK's controls and the editor to Lapse's red via the
  provider's `accentColor`.
If the browser closes (or the page refreshes) while the edit hold is
live, the publish page previously sat on the compile spinner until the
hold lapsed and the session auto-published uncut. Now it probes the
session's edit hold via the device's stored Lookout token and reopens
the editor while editing is still possible.

The editor modal is extracted into a shared EditorModal used by both
the recorder and the publish page; since the editor is the only
SDK-rendered surface in Lapse, the accent color moves there too
(setAccentColor on mount) instead of living on LookoutProvider.
@anscg
anscg marked this pull request as draft August 9, 2026 21:23
@socket-security

socket-security Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedmp4-muxer@​5.2.21001007950100
Added@​number-flow/​react@​0.6.21001007391100
Added@​phosphor-icons/​react@​2.1.109410010080100

View full report

@anscg
anscg marked this pull request as ready for review August 9, 2026 22:46
@Lamparter
Lamparter self-requested a review August 10, 2026 10:18
anscg and others added 2 commits August 10, 2026 23:24
The Lookout bump adds `clockOffset.test.ts` to `@lookout/shared`, whose
build is a plain `tsc` over all of `src`. Nothing in the Lapse workspace
provides `vitest`, so the test file's import fails to resolve and the
root build dies on TS2307 before anything else compiles.

Add `vitest` alongside the `tsup` that's already hoisted for the
vendored React client, so the vendored packages' tooling resolves from
the workspace root the same way it does in the Lookout repo.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Desktop is the default recording mode, and the tab that launched it had no
way of knowing the recording ever finished: the SDK status effect that
navigates to publish only exists while Lapse itself is capturing, and the
site-wide draft check in `_app.tsx` deliberately skips `/timelapse/create`.
So the one page a desktop recorder is left on is the one page that can't
move them along, and getting to publish meant wandering back into Lapse
and being redirected from somewhere else.

Lookout has had a redirect hook for this since `3bbf3ca` - the desktop app
opens it in the user's default browser the moment the session flips to
`complete`, including after publishing from its own editor. We just never
set it. Now session creation points it at a handoff page of our own.

The hook is immutable once a session exists, which shapes two things: the
draft's ID is minted before the session so the URL can contain it, and the
hook targets `/timelapse/handoff/:draftId` rather than the publish page
directly, so the URL every past session carries stays valid if the flow
behind it moves.

That page also can't assume a signed-in user, since it opens in whichever
browser is the OS default. Rather than a second sign-in, it points them
back to the browser they recorded from - where opening Lapse at all lands
them on publish already - and keeps sign-in as a fallback.

Alongside it, two things the desktop flow was missing:

- The `lookout://` deep link is now shown on the "Opening Lookout" screen,
  copyable. Lookout has a paste-a-link box for when the handoff doesn't
  fire, and this is the only place that link exists to be copied from.
- Lapse no longer opens its own cut editor for a desktop recording. The
  edit hold on such a session belongs to the desktop app's editor window,
  which is likely open on it right now; a second editor here had both
  surfaces renewing the same lease and racing to write cuts. The status
  poll now reports whether Lookout recorded the session from the desktop
  (via its `clientInfo`), and runs before the edit-hold probe so the probe
  knows to stay out of it.

Deploying this needs `WEB_BASE_URL` set - it's where the hook points, and
session creation throws without it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@anscg

anscg commented Aug 10, 2026

Copy link
Copy Markdown
Author

meow should be ready

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