Skip to content

fix: mobile UI — input layout, sidebar overlap, session switch independence#498

Merged
PureWeen merged 4 commits intomainfrom
fix/mobile-ui-fixes
Apr 4, 2026
Merged

fix: mobile UI — input layout, sidebar overlap, session switch independence#498
PureWeen merged 4 commits intomainfrom
fix/mobile-ui-fixes

Conversation

@PureWeen
Copy link
Copy Markdown
Owner

@PureWeen PureWeen commented Apr 4, 2026

Purely mobile fixes, split from #487.

Changes

  • Bridge session switch independence — mobile SwitchSession no longer changes desktop's active session
  • Compact input layout — mode switcher (Chat/Plan/Autopilot) condensed to dropdown on mobile, smaller textarea, status bar extras hidden
  • Sidebar filter bar overlap fixed — Attention/All/Idle bar no longer floats over session list in mobile flyout

Desktop is untouched — all CSS changes are inside @media (max-width: 640px) or scoped to .mobile-flyout-sidebar.

@PureWeen
Copy link
Copy Markdown
Owner Author

PureWeen commented Apr 4, 2026

🤖 Multi-Model Code Review — R1 (PR #498)

CI Status: ℹ️ No CI checks configured
Prior comments: None (fresh review)


Summary

Mobile UI improvements: bridge session switch independence, compact input layout with mode dropdown, sidebar flyout overlap fix, Android keyboard handling, and restored log/prompts in status bar.


🔴 CRITICAL — Test assertion null bug

File: PolyPilot.Tests/WsBridgeIntegrationTests.cs:1108
Flagged by: 3/3 reviewers

Assert.NotEqual("switch-b", _copilot.GetActiveSession()?.Name ?? "switch-b");

If GetActiveSession() returns null, ?.Namenull, ?? "switch-b""switch-b". The assertion becomes NotEqual("switch-b", "switch-b")misleading failure that looks like the old bug is present when actually the session was lost entirely.

Additionally, the assertion is too weak — it passes trivially because "switch-a" was already the active session before the switch. It should positively assert the active session stayed as "switch-a":

Assert.Equal("switch-a", _copilot.GetActiveSession()?.Name);

🟡 MODERATE — AdjustResize deprecated on API 30+ / edge-to-edge conflict

File: PolyPilot/Platforms/Android/MainActivity.cs:12
Flagged by: 3/3 reviewers

SoftInput.AdjustResize is deprecated on Android 11+ (API 30) and may not resize the WebView in edge-to-edge mode on modern devices. The repo instructions note edge-to-edge is the .NET 10 MAUI default and insets are handled in CSS/JS. This may work correctly on the test device but could fail on API 30+ with gesture navigation.

Recommendation: Test on an API 30+ device. If the keyboard still obscures content, consider visualViewport API or env(keyboard-inset-height) instead.


🟡 MODERATE — BroadcastSessionsList sends desktop active session to mobile

File: PolyPilot/Services/WsBridgeServer.cs (SwitchSession handler)
Flagged by: 3/3 reviewers

After removing SetActiveSession, the BroadcastSessionsList() call still sends ActiveSession = _copilot.ActiveSessionName (the desktop's active session) to all clients. Mobile WsBridgeClient updates ActiveSessionName from this broadcast. If mobile UI reads ActiveSessionName to highlight the current session, it will immediately revert to the desktop's view after switching.

Recommendation: Consider removing BroadcastSessionsList() from the SwitchSession handler (no list state actually changed), or tracking per-client active session separately.


🟡 MODERATE — Blazor select null propagation

File: PolyPilot/Components/ExpandedSessionView.razor
Flagged by: 2/3 reviewers

<select ... @onchange="e => OnSetInputMode.InvokeAsync(e.Value?.ToString())">

e.Value is object? — if the browser sends an empty or unrecognized value, null propagates to OnSetInputMode. Should fall back to current mode:

@onchange="e => OnSetInputMode.InvokeAsync(e.Value?.ToString() ?? InputMode)"

Test Coverage

  • SwitchSession_BroadcastsUpdatedActiveSession updated for new behavior
  • ⚠️ Test assertion has null-safety bug (see CRITICAL above)
  • ⚠️ No test for history delivery after mobile switch (the positive path of the new behavior)

Verdict: ⚠️ Request Changes

  1. Fix test assertion — use Assert.Equal("switch-a", _copilot.GetActiveSession()?.Name) instead of the null-coalescing NotEqual
  2. Null-guard the select — add ?? InputMode fallback
  3. Consider removing BroadcastSessionsList() from SwitchSession handler (no state changed)
  4. Verify AdjustResize on API 30+ device — may need alternative approach for modern Android

PureWeen and others added 4 commits April 4, 2026 12:31
…switch

- Don't switch desktop active session when mobile sends SwitchSession via bridge
- Compact mobile input: mode switcher as dropdown, smaller textarea, hide status extras
- Fix sidebar filter bar (Attention/All/Idle) overlapping session list on mobile flyout
- Add mode-select-mobile dropdown (hidden on desktop, shown on mobile 640px)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…sessions

- Remove sidebar-organize-shell-compact from flyout (caused position:absolute on filter bar)
- Add inline style on sidebar-top-tools in flyout to force position:static

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…estore log/prompts

- Add WindowSoftInputMode=AdjustResize to MainActivity so WebView shrinks when keyboard opens
- Use 100dvh (with 100vh fallback) for page height to respect dynamic viewport
- Remove nav-bar-height padding from mobile status bar (AdjustResize handles it)
- Restore log/prompts in mobile status bar (was hidden, now visible with footnote size)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ry broadcast

- Test: Assert.Equal("switch-a", ...) instead of brittle NotEqual with null fallback
- Select: null-guard onchange with ?? InputMode fallback
- Bridge: remove BroadcastSessionsList() from SwitchSession (no state changed)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen force-pushed the fix/mobile-ui-fixes branch from 6f6a76a to b9075c6 Compare April 4, 2026 17:32
@PureWeen PureWeen merged commit 94076e5 into main Apr 4, 2026
@PureWeen PureWeen deleted the fix/mobile-ui-fixes branch April 4, 2026 17:33
PureWeen added a commit that referenced this pull request Apr 4, 2026
CSS cleanup (from post-merge review of #498):
- Restore env(safe-area-inset-bottom) on mobile status bar for gesture nav clearance
- Remove dead 'display: block' before 'all: unset' in mode-select-mobile
- Consolidate duplicate .mobile-flyout-sidebar rules

PR number on mobile:
- Add PrNumber to AgentSessionInfo and SessionSummary (bridge message)
- Populate PrNumber from WorktreeInfo when linking session to worktree
- WsBridgeServer includes PrNumber in session list broadcasts
- Mobile sync paths map PrNumber from SessionSummary to AgentSessionInfo
- ExpandedSessionView uses Session.PrNumber for prompt auto-fill on mobile

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Apr 4, 2026
Follow-up to #498 addressing post-merge review findings.

### Changes
1. **Restore safe-area-inset-bottom** on mobile status bar padding —
prevents gesture nav overlap when keyboard is closed
2. **Remove dead CSS** — `display: block` before `all: unset` on
mode-select-mobile was immediately reset
3. **Consolidate duplicate rules** —

### Testing
- 3,129 tests passing
- CSS-only changes, all gated behind `.mobile-flyout-sidebar` or `@media
(max-width: 640px)` — desktop untouched

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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