fix: repair trend lab scans and dark-theme loading state - #67
Merged
Merged
Conversation
the topic field was seeded with 'AI agents', so switching to the trend lab tab looked like a pending search. start it empty and let the existing placeholder carry the hint. the submit handler already ignores an empty topic.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
the scan asked for AI insights the dashboard never renders. that model call took about 21s of a 50s cold request against a 20s client budget, so every scan aborted with a connection error. request deterministic insights instead, which also drops the call from 25 to 15 credits, and give the scan a 60s budget since a cold eight-video sample still needs about 23s through the processor container. trend-loading and trend-refresh-status were left behind in the legacy css layer with a hardcoded white background, so the loading card rendered white with near-invisible ink in the dark theme. bind them to the dashboard surface, rule and ink tokens like trend-empty and trend-card already are, and tokenize the status spinner ring.
main now owns request deadlines: #69 moved the api helper into web/lib/platform-request.ts and removed every client timeout, so the 60s trend scan budget this branch added is gone and the scan waits for the API outcome instead. kept from this branch: insights=deterministic, which stops the scan paying about 21s and 10 credits for an AI block the dashboard never renders, the dark-theme tokens for the loading and refresh cards, and the empty topic input.
Owner
Author
|
Reconciled with #69, which landed first and moved request handling into The 60s trend scan budget this PR proposed is dropped. The scan now waits for the API outcome, so a 65s scan finishes instead of failing at an arbitrary client cutoff, and a real API timeout surfaces as the API stated it. What remains here is the work #69 does not cover:
Merged main in rather than rebasing, so no already-pushed commit was rewritten. |
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.
Summary
Three Trend Lab fixes in the dashboard.
Scans always failed with a connection error. The scan requested AI insights that nothing in
web/renders, because/providers/:provider/trendstreats anyinsightsvalue other thandeterministicas "run the model". Measured against the live API:The client aborted at 20s, so the response never arrived. The scan now sends
insights=deterministic, which also drops the operation from 25 to 15 credits. The Trend Lab's AI section is unaffected: it comes from the separate/v1/trends/planbutton, which builds its payload from report fields, not fromreport.insights.A cold eight-video sample still needs about 23s through the processor container, so the scan gets its own 60s budget. The global 15s request timeout is unchanged.
The loading card rendered white in the dark theme.
globals.csskeeps a legacy layer with hardcoded#fff, and a later workbench layer rebinds those selectors to theme tokens..trend-loadingand.trend-refresh-statuswere never migrated, so they kept a white background while--inkwent light, leaving "Building a fresh topic sample…" almost unreadable. Both now use the same--color-dashboard-surface/--color-dashboard-rule/ ink tokens as.trend-emptyand.trend-card, and the status spinner ring is tokenized to the accent.The topic input was prefilled with
AI agents, so switching to the tab looked like a search was already staged. It starts empty and the existing placeholder carries the hint. The submit handler already trims and bails on an empty topic. TheAI agentsquick-scan preset is untouched, since that one is an explicit click.Not included
A cold scan returns fewer videos than requested.
researchTrendTopicfans out 6 candidates at a time, which is 12 concurrent container calls, and the processor sheds the excess: a fresh topic came back with 5 of 8 videos plusThis YouTube processor is at capacity.warnings. That needs a platform change and is separate work.Testing
npx tsc --noEmitinweb/passes.video2ctx api GET:videos,hashtags,titlePatterns,durationMix,summary, andconfidenceare all present,insightsabsent.