Repository navigation
feat(action-center): say on the Action Center when a brand's first analysis is running - #1248
Conversation
New Ansvisor (AC-ALT2 spec, §3), PR 6 of 7: everything starts at the Action Center. One home path (config/home.ts, DASHBOARD_HOME) for: - /dashboard and /dashboard/action-center (was Visibility and KPIs); - the end of onboarding and the Stripe success route after payment; - a new brand from the brands page; - the onboarding preview's highlighted sidebar item. The Action Center's tabs read Actions · Signals · KPIs · History (lib/action-center/tabs.ts). The Stripe success route still passes the first tracking run's ?jobId=; TrackingJobHandoff, in the dashboard layout, keeps it for Visibility's progress bar (which used to read it from its own address) and takes it out of the address. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…alysis is running After the payment, a new brand or onboarding, people now land on the Action Center's Actions (ansvisor#1238) while the first tracking run is still going, and only Visibility showed it. A note under the Action Center's tabs now says the first analysis is running (or queued), with the progress when this browser started it and a link to follow it on Visibility. It shows while the brand has no completed run and one is under way: from the tracking_runs ledger, so any browser's run counts, or, while the job still waits for the worker, from the job this browser saved. It reads every 30 s and stops once the brand has a completed run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@gkhngyk this is the "First analysis running" note you suggested on #1238. It's stacked on #1238, so it should merge after it. It reads |
Takes main after ansvisor#1238's squash; only this PR's own change is applied on top. Claude-Session: https://claude.ai/code/session_0121amRjX7UFrgmGELAtkc7A
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good. It carries #1238's commit, so it merges right after #1238. The note reads the run ledger and the saved job the way Visibility does, and it stops once the brand has a completed run.
Small things, none blocking:
- Polling never stops for an idle brand. A brand with no completed run and nothing under way, such as one that never started tracking, keeps reading every 30 s for as long as the page is open. Stop once neither the ledger nor the saved job shows a run.
- A long first run loses the note.
getTrackingWindowtreats an unfinished run older than 2 hours as crashed. In another browser, the note then disappears during a long first run, and the copy says a first run can take an hour or two at busy times. queuedBodyis too specific. It says another analysis is running, but queued also covers a job the worker hasn't picked up yet.
Summary
Follow-up from #1238's review: "after payment, a new brand or onboarding, people now land on Actions while the first run is still going, and nothing there shows it; the progress bar appears only on Visibility."
Stacked on #1238 (
feature/land-on-actions, b02def9): merge after it. Until then this PR also shows #1238's commit; its own change is cc2ab01.The note (
components/action-center/first-run-note.tsx)border-primary/20 bg-primary/5, spinner); no new colors.When it shows
getTrackingWindow().lastRunAtis null) and one is under way:tracking_runsledger (activeRun), so a run any browser started counts;loadTrackingJob, which feat(action-center): land on the Action Center's Actions, its first tab #1238'sTrackingJobHandofffills from?jobId=):waiting/delayedread as queued,activeas running; a failed or missing job shows nothing.The
ActionCenterTabschange is the note under the<nav>(the nav's lines are re-indented by the fragment). The page files aren't touched, so it doesn't collide with the Getting started PRs (#1235, #1236, #1243) onactions/page.tsx.Related issue
Follow-up to #1238.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Unit test (
first-run-note.test.tsx):In the browser (I added a temporary brand with one
tracking_runsrow and nocompleted_at, then deleted it):completed_at: within 30 s the note goes, without a reload.I checked it in light and dark mode, at 1440 and 1024 px.
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)yarn test(1789) andyarn buildpass too.🤖 Generated with Claude Code