feat(web): home & sidebar polish — activity indicators, notifications, borders, host labels#248
feat(web): home & sidebar polish — activity indicators, notifications, borders, host labels#248mgabor3141 wants to merge 8 commits into
Conversation
Try this PRcurl -sSfL https://gmux.app/install-pr.sh | sh -s -- 248Built from |
|
| Filename | Overview |
|---|---|
| apps/gmux-web/src/store.ts | Adds localHostLabel computed signal; correctly handles single-host, multi-host, no-hostname, and peer-only scenarios with explicit boolean tracking instead of the empty-string sentinel. |
| apps/gmux-web/src/store.test.ts | Adds 4 tests for localHostLabel; the fourth test description is slightly misleading — it says 'all share one host' but only contains a single peer project rather than multiple projects sharing one peer. |
| apps/gmux-web/src/host-suffix.tsx | Adds local prop to skip peer-status lookup for the local hostname, directly addressing the previously-flagged name-collision risk. |
| apps/gmux-web/src/sidebar.tsx | Adds waiting-state indicator on the logo using useArrivalPulse with unreadCount as the generation counter; mirrors the hamburger badge logic cleanly. |
| apps/gmux-web/src/home.tsx | Moves NotifPrompt into the Activity header as a right-aligned affordance; switches to compact icon-only denied state. |
| apps/gmux-web/src/main.tsx | Simplifies hamburger badge to waiting-state only; removes unused backgroundActivity signal import and DotState type import. |
| apps/gmux-web/src/styles.css | Raises border lightness tokens, adds sidebar waiting dot, insets folder dividers via ::before, moves notification prompt CSS, and switches mobile safe-area inset from padding-bottom to margin-bottom. |
| apps/gmux-web/src/project-hub.tsx | Minimal change: passes localHostLabel to HostSuffix for multi-host project title labelling, with local={!projectPeer} guard. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
UC[unreadCount signal] --> WC{waitingCount > 0?}
WC -- yes --> BG[bg-waiting class on logo/hamburger]
WC -- yes --> AP[useArrivalPulse unread + generation]
WC -- no --> NONE[no dot shown]
AP -- fires --> ANIM[bg-arriving class]
ANIM -- 560ms --> BG
F[folders signal] --> LHL{hostCount > 1?}
H[health.hostname] --> LHL
LHL -- yes + hostname present --> LABEL[localHostLabel = hostname]
LHL -- no OR no hostname --> UNDEF[localHostLabel = undefined]
LABEL --> HS[HostSuffix local=true]
UNDEF --> HSN[HostSuffix peer=undefined returns null]
HS --> RENDER[render host badge always-connected]
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/gmux-web/src/store.test.ts:586-592
The test description says "all share one host" which implies multiple peer projects all pointing at the same peer, but the setup only contains a single peer project (`peer: 'unraid'`). The description would more accurately read "only one distinct peer host, no local folders" — or, if the intent was to cover the multi-project same-peer scenario, a second peer project should be added.
```suggestion
it('is undefined when the only distinct host is a remote peer (no local folders)', () => {
_setRawWorld({
health: { version: 'dev', hostname: 'workstation' },
projects: [{ slug: 'b', peer: 'unraid' }],
})
expect(localHostLabel.value).toBeUndefined()
})
```
Reviews (2): Last reviewed commit: "feat(web): show local host on project he..." | Re-trigger Greptile
fb13d69 to
4a53371
Compare
Summary
A batch of home/sidebar UI polish, building on the recently-merged dashboard work. Each concern is a separate commit; squash-merging is fine.
Changes
Sidebar
margin-bottom..folder + .folderlines are pulled in to the 14px content margin (via::before) instead of spanning edge-to-edge, so the list reads as grouped rows rather than a hard grid. The header keeps its full-width border as a stronger zone boundary.Activity indicators
vertical-align: middle(baseline + ½ x-height — no pixel nudging). Re-blinks when another session enters the waiting state.Home
Borders / hosts
--borderwas only 22% lightness (barely above the near-black surface), so outlines and dividers read as faint. Raised to 32%, with--border-strongbumped to 38% to preserve the two-tier relationship.Testing
localHostLabel), lint + build clean.