Skip to content

Commit 252a917

Browse files
committed
fix(047): anchor weather at 50% display midpoint, clean up deploy trigger
Dashboard header: weather now starts at the display midpoint (50%) instead of right after the left text. Pads from worst-case left width (228px on G1) to midpoint (288px on G1) = 10 spaces of fixed padding. Also cleaned up porter-debug.yml to only active branches.
1 parent 220d9a4 commit 252a917

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

.github/workflows/porter-debug.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@ on:
55
push:
66
branches:
77
- cloud/issues-047
8-
- cloud/issues-044
9-
- new-context-soniox
10-
- cloud/044-ci-build-audit
11-
- hotfix/cloud-observability
12-
- hotfix/crash-diagnostics
13-
- cloud/062-mongodb-audit
14-
- hotfix/graceful-shutdown
15-
- hotfix/remove-forced-gc-add-livez
8+
- cloud/issues-048-merge
169
paths:
1710
- "cloud/**"
1811
- ".github/workflows/porter-debug.yml"

cloud/packages/cloud/src/services/session/dashboard/DashboardManager.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -699,29 +699,33 @@ export class DashboardManager {
699699
* (288px on G1) instead of the resolved text (≤228px on G1), producing
700700
* wrong spacing.
701701
*
702-
* Instead we use a fixed gap based on the pre-computed worst-case left width
703-
* for the connected glasses profile. Different glasses models have different
704-
* display widths and fonts, so the spacing is computed per-profile.
702+
* Instead we pad from the worst-case left width to the display midpoint (50%),
703+
* so the weather always starts at the second half of the screen. Different
704+
* glasses models have different display widths and fonts, so the spacing is
705+
* computed per-profile.
705706
*/
706707
private composeHeaderRow(leftTokenText: string, rightText: string, profile: DisplayProfile): string {
707708
const displayWidth = profile.displayWidthPx;
708709
const metrics = getHeaderMetrics(profile);
709710

710-
// Fixed gap: ~5% of display separates left and right columns
711-
const gapSpaces = Math.max(2, Math.floor(
712-
(displayWidth * 0.05) / metrics.spaceWidthPx,
713-
));
714-
const gapWidthPx = gapSpaces * metrics.spaceWidthPx;
711+
// Right column starts at the display midpoint (50%).
712+
// The left column (date/time/battery) worst case is ~40% of display,
713+
// so padding to 50% gives a consistent "second half" start for weather.
714+
const midpointPx = Math.floor(displayWidth * 0.5);
715715

716-
// Right column gets everything after the worst-case left + gap
717-
const rightMaxPx = displayWidth - metrics.leftMaxWidthPx - gapWidthPx;
716+
// Pad from worst-case left width to the midpoint
717+
const pixelsToPad = Math.max(0, midpointPx - metrics.leftMaxWidthPx);
718+
const padSpaces = Math.max(2, Math.floor(pixelsToPad / metrics.spaceWidthPx));
719+
720+
// Right column gets the second half of the display
721+
const rightMaxPx = displayWidth - midpointPx;
718722

719723
// Truncate right text to fit (single line)
720724
const measurer = new TextMeasurer(profile);
721725
const wrapper = new TextWrapper(measurer, { breakMode: "character-no-hyphen" });
722726
const rightLine = wrapper.wrap(rightText, { maxWidthPx: rightMaxPx, maxLines: 1 }).lines[0] || "";
723727

724-
return `${leftTokenText}${" ".repeat(gapSpaces)}${rightLine}`;
728+
return `${leftTokenText}${" ".repeat(padSpaces)}${rightLine}`;
725729
}
726730

727731
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)