Skip to content

Keep the live view on screen, with box-page colours and plan - #54

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/live-view-scroll-colors-6aee
Aug 21, 2026
Merged

Keep the live view on screen, with box-page colours and plan#54
cursor[bot] merged 2 commits into
mainfrom
cursor/live-view-scroll-colors-6aee

Conversation

@frahlg

@frahlg frahlg commented Aug 21, 2026

Copy link
Copy Markdown
Member

When you tap a planet on Now, the live sheet used to appear at the bottom of the page. On a phone that meant the house scrolled off-screen and the line wore a different colour from the bubble you just tapped. The “What FTW does next” card also claimed a live charge that the readings above it did not show.

This matches those three surfaces to the box’s own Overview:

  • The live sheet (and the charger sheet) are parked on the app shell, outside the scrolling view, so position: fixed stays on the screen. Now itself always opens at the house instead of restoring a scroll that had walked down to the fuse.
  • The live number and chart use the same planet colours as the hero: grid and battery by direction, solar amber, battery-at-rest cyan.
  • The plan card is the box page’s command-and-clock shape (Charge battery at 2.9 kW / Now, until 16:15 / reason / safety), with a Plan active badge, instead of a present-tense sentence that fights the live reading.

Tests cover the portal, the colour mapping, the brief copy, Now opening at the top, and that opening a live line does not move the scroller.

Open in Web Open in Cursor 

A tap on a bubble parked a position:fixed sheet inside the scrolling
view, so the house walked off the bottom of the phone. The line also
wore a different colour from its bubble, and the plan card claimed a
live charge the readings did not show.

Park the sheet on the app shell, colour it from the same planet map,
open Now at the house, and tell the next step the way Overview does.

Co-authored-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ftw-webapp 38a13b7 Commit Preview URL

Branch Preview URL
Aug 21 2026, 12:19 PM

Co-authored-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@frahlg
frahlg marked this pull request as ready for review August 21, 2026 12:18
@cursor
cursor Bot merged commit 7ac7ac0 into main Aug 21, 2026
3 checks passed
@cursor
cursor Bot deleted the cursor/live-view-scroll-colors-6aee branch August 21, 2026 12:21

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38a13b7216

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +85 to +89
const color = $derived(planetColor(role as FlowColorRole, raw))
const socPct = $derived.by(() => {
if (role !== 'battery') return null
const permille = (fields ?? site.session.fields).get(FID.BATTERY_SOC)
return permille === undefined ? null : Math.round(permille / 10)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the selected battery when showing its readings

When a multi-battery site is switched to split bubbles, flowReadingsFromStatus gives each bubble its own direction and SoC, and the click event includes that bubble's name/id; however, Now retains only the role, so these new color and SoC values are calculated from the aggregate stream fields. Tapping a discharging 40% pack can therefore open a sheet colored for the aggregate direction and displaying the aggregate SoC rather than the selected pack's 40%. Preserve the clicked device identity and use its status values for these fields.

Useful? React with 👍 / 👎.

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.

2 participants