Skip to content

feat(production): live machine status on all three surfaces - #16

Merged
tech5-opti merged 1 commit into
mainfrom
tushar
Aug 21, 2026
Merged

feat(production): live machine status on all three surfaces#16
tech5-opti merged 1 commit into
mainfrom
tushar

Conversation

@tech5-opti

Copy link
Copy Markdown
Collaborator

Machine Management, the machine detail page and the Production Overview all showed a snapshot taken when the page rendered. The list was worse than frozen — it read persisted rows that only moved when somebody pressed Sync, so it could be hours behind the printer.

All three now poll, via one hook (hooks/use-fleet-poll.ts) so the cadence is a single decision rather than three that drift apart. Follows the pattern design-detail.tsx already established: seed initialData from the server render, poll a server action rather than a bare fetch, vary the interval by state.

Cadence

10s while something is happening on the bed, 30s when nothing is — backed off rather than stopped, because an operator who starts a print from the printer's own touchscreen would otherwise sit in front of a page reading "Ready to print" indefinitely.

Seeding from the RSC render means no loading flash and no empty first paint. refetchIntervalInBackground stays at its default, so a backgrounded tab polls nothing at all.

Where the data comes from

The list and Overview read persisted rows, not BambuBuddy — the backend's new periodic sync keeps those current, so their cost is a Postgres read regardless of viewer count. Only the detail page reads through to the printer, and the backend caches that (Tensor-Core#10).

AutoRefresh

Removed from the machines page: it router.refresh()es the whole RSC tree, which alongside a query polling the same endpoint is two mechanisms fetching the same data at overlapping intervals. Left in place on batches and jobs, which have no query layer yet.

Scope of the change

Three components became client components purely to poll; their markup is unchanged. FleetMachineSummaryCard and FleetMachineLiveCard needed no edits at all — already pure props components, which is what made this a prop swap rather than a rewrite. The queue board deliberately does not poll: it has drag state a refresh would fight.

Requires Tensor-Core#10.

🤖 Generated with Claude Code

Machine Management, the machine detail page and the Production Overview
all showed a snapshot taken when the page rendered. The list was worse
than frozen - it read persisted rows that only moved when somebody
pressed Sync, so it could be hours behind the printer.

All three now poll, via one hook so the cadence is a single decision
rather than three that drift. It follows the pattern design-detail.tsx
already established: seed initialData from the server render, poll a
server action rather than a bare fetch, and vary the interval by state.

10s while something is happening on the bed, 30s when nothing is - backed
off rather than stopped, because an operator who starts a print from the
printer's own touchscreen would otherwise sit in front of a page reading
"Ready to print" indefinitely. Seeding from the RSC render means no
loading flash and no empty first paint, and refetchIntervalInBackground
stays at its default so a backgrounded tab polls nothing at all.

The list and Overview read persisted rows, not BambuBuddy: the backend's
new periodic sync keeps those current, so their cost is a Postgres read
regardless of how many people are watching. Only the detail page reads
through to the printer, and the backend caches that.

AutoRefresh is removed from the machines page - it router.refresh()es the
whole RSC tree, which alongside a query polling the same endpoint is two
mechanisms fetching the same data at overlapping intervals. Left in place
on batches and jobs, which have no query layer yet.

Three components became client components purely to poll; their markup is
unchanged. FleetMachineSummaryCard and FleetMachineLiveCard needed no
edits at all - they were already pure props components, which is what
made this a prop swap rather than a rewrite. The queue board deliberately
does not poll: it has drag state a refresh would fight.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tech5-opti
tech5-opti merged commit 511b02a into main Aug 21, 2026
2 of 3 checks passed
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tensor Building Building Preview Aug 21, 2026 10:19am
tensor-9bct Ready Ready Preview Aug 21, 2026 10:19am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: da99210b-c87e-49c9-a2c2-7e6af84f626d


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

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