Link a finished timelapse to a devlog (reassure + attach)#754
Conversation
Users thought their Lookout recording vanished: after recording, the
timelapse was saved on Stardance's side but never surfaced again and was
tied to nothing. The backend already supported linking a session to a
devlog (Projects::DevlogsController#attach_lookout_sessions reads
params[:post_devlog][:lookout_session_ids]) but nothing in the UI ever
sent it, and devlogs never showed a timelapse.
Wire it up (flag: timelapse_devlog, off by default):
- Recorder done screen: reassure ('Saved! We've got your timelapse') and
turn 'Post a Devlog' into 'Add it to a devlog', carrying the session id
+ just_recorded=1 to the project page.
- Project page: ProjectsController#show reads lookout_session_id and sets
@pending_lookout_session (attachable, owned by the user, not yet linked).
- Composer: renders a hidden post_devlog[lookout_session_ids][] field for
that session + a reassurance banner ('Your timelapse (Xm) is saved and
will be attached to this devlog'). The modal controller auto-opens the
composer on ?just_recorded=1 and strips the params.
- Devlog card: shows a 'Timelapse attached' chip when the devlog has a
linked session, so the connection is visible on the post.
The actual timelapse frame as the devlog's image is the fast follow.
Note: the card chip does a per-card lookout_sessions.exists? (gated behind
the flag to bound cost during rollout); preload when this goes wide.
- Broaden the pending-session lookup to a new :linkable scope (stopped/compiling/complete) so a background sync flipping a just-stopped session to compiling mid-flow no longer silently drops the attach. Leaves :attachable (finished-video only) intact for the hardware-review recordings list. - Keep lookout_session_id in the URL after auto-opening the composer; only strip just_recorded. A pre-submit refresh now still resolves @pending_lookout_session instead of losing the link. - Hide the duration in the reassurance banner when it hasn't synced yet, so it no longer reads "Your timelapse (0s)".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit eb3dd94. Configure here.
| <div class="feed-composer__timelapse-note" role="status"> | ||
| Your timelapse<% if pending_lookout_session.duration_seconds.to_i > 0 %> (<%= helpers.format_seconds(pending_lookout_session.duration_seconds) %>)<% end %> is saved and will be attached to this devlog. | ||
| </div> | ||
| <% end %> |
There was a problem hiding this comment.
Project chip drops timelapse link
Medium Severity
After recording, the composer keeps a hidden post_devlog[lookout_session_ids][] for the timelapse and tells the user it will attach, but the project-page composer still shows project chips. Choosing another chip retargets the form to that project’s devlogs endpoint while the hidden id still refers to a session scoped to the original project, so attach_lookout_sessions finds no row and the timelapse is not linked.
Reviewed by Cursor Bugbot for commit eb3dd94. Configure here.


The problem
People think their Lookout recording vanished. After recording, the timelapse is saved on Stardance's side — but it never surfaces again and isn't tied to anything, so it feels lost.
Digging in: the backend already supports linking a session to a devlog (
DevlogsController#attach_lookout_sessionsreadsparams[:post_devlog][:lookout_session_ids]), but nothing in the UI ever sends it, and devlogs never display a timelapse. So the wiring exists — it's just not connected.This PR — "reassure + link first" (flag:
timelapse_devlog, off by default)just_recorded=1back to the project page.ProjectsController#show): readslookout_session_id, sets@pending_lookout_session(must be attachable, owned by the user, not already linked).post_devlog[lookout_session_ids][]for that session + a reassurance banner ("Your timelapse (Xm) is saved and will be attached to this devlog"). Themodalcontroller auto-opens the composer on?just_recorded=1and strips the params.Backend link + the destination flow are unchanged; on submit the existing
attach_lookout_sessionssetsdevlog_id.Turning it on (and rolling back)
The whole feature is gated on the
timelapse_devlogFlipper flag, registered inconfig/initializers/flipper.rb. It's a per-actor flag (Flipper.enabled?(:timelapse_devlog, current_user)), so you can enable it for yourself first, then a percentage, then everyone. Enable it the same way aslookout.Heads up: the flag gates both sides — the author flow (recorder → "Add it to a devlog") and the viewer's "Timelapse attached" chip. So test with the flag enabled for the user who records and views.
Option A — Flipper UI (
/admin/flipper, admin-gated):https://stardance.hackclub.com/admin/flipper, opentimelapse_devlog.flipper_idand register it.Option B — Rails console (Coolify
weborworker,bin/rails console):Prod is byte-for-byte unchanged until you enable it for an actor.
Deliberately deferred (fast follow)
The actual timelapse frame as the devlog's image (auto-attaching a screenshot). Lookout exposes a
thumbnailUrl; the plan is a same-origin thumbnail proxy + pre-attach into the composer so the screenshot shows in the draft.Notes / tradeoffs
attachablescope,format_secondshelper, the modal query-param opener pattern, and BEM classes in_feed.scss.lookout_sessions.exists?; gated behind the flag to bound cost during rollout. Preloadlookout_sessionson the timeline query before this goes wide (follow-up).Testing
ruby -c/ ERB parse /node --checkall clean.:timelapse_devlogon): record a timelapse → "Add it to a devlog" → project page opens the composer with the reassurance banner + hidden session field → post → devlog shows the "Timelapse attached" chip and the session'sdevlog_idis set.Note
Medium Risk
Touches devlog create params and session linking with Flipper gating; card
exists?queries may need preload before wide rollout, but behavior is unchanged until the flag is enabled.Overview
Under the
timelapse_devlogFlipper flag (off by default), this connects the existing devlog attach path (post_devlog[lookout_session_ids][]→attach_lookout_sessions) to the UI so finished Lookout sessions don’t feel lost.Author flow: After recording, the done screen becomes “Add it to a devlog” with copy that the timelapse is saved, linking to the project with
lookout_session_idandjust_recorded=1.ProjectsController#showloads alinkablesession (new scope:stopped/compiling/complete, broader thanattachable) owned by the user and not yet linked. The devlog composer shows a reassurance banner plus a hidden session id field;modal_controlleropens the composer on?just_recorded=1and strips only that param (keepslookout_session_idfor refresh-before-submit).Feed: Devlog cards show a mint “Timelapse attached” indicator when the post has linked lookout sessions (flag-gated; uses
lookout_sessions.exists?per card).Styling adds composer note and card timelapse chip classes in
_feed.scss. No new endpoints or migrations.Reviewed by Cursor Bugbot for commit eb3dd94. Bugbot is set up for automated code reviews on this repo. Configure here.