Skip to content

fix: prevent sidebar toggle icon clipping at display scales - #1690

Merged
karkarl merged 1 commit into
mainfrom
karkarl-sidebar-button-scaling
Oct 15, 2026
Merged

karkarl merged 1 commit into
mainfrom
karkarl-sidebar-button-scaling

Conversation

@karkarl

@karkarl karkarl commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: the sidebar toggle icon can appear cropped when the app is viewed at a different display scale or resolution.

User Impact

User impact: Workspace collapse/reopen and Settings pane toggles have room for their complete icons without changing their 40-DIP targets or native interaction states.

Why This Change Was Made

These buttons already use WinUI's built-in SubtleButtonStyle, not a custom template. Its default text-button padding leaves only 16 DIPs for a 16-DIP icon inside the fixed-width target. Set Padding="0" on the three icon-only toggles, keeping the native template, theme resources, focus handling, and pane behavior. Add a markup guard and a mounted native layout test for glyph fit and rounding clearance.

Evidence

The three new native layout cases pass with the fix and fail the rounding-clearance assertion against the original XAML at 125% scaling. Seven focused layout cases and four real-app light/dark sidebar and Settings checks passed. Full required validation passed on the final rerun; two earlier queued-chat timing failures were outside this change.

Direct review covered the small diff. A separate rubber-duck review was not used for this three-setter layout fix; no services, navigation logic, or templates change.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-winui-interactive: verify visible sidebar toggle glyphs and existing pane interactions in the isolated WinUI app.
  • windows-11-arm64: native ARM64 build, launch, and WinUI layout proof on the validation host.

Validation

Run on Windows ARM64 with OPENCLAW_REPO_ROOT set to this worktree and an isolated OPENCLAW_TRAY_DATA_DIR for the required suites:

  • .\build.ps1: passed, all five production projects. Repeated successfully for the manual preview.
  • dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --verbosity quiet: passed, 4,262 passed, 35 skipped, 0 failed.
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --verbosity minimal: passed, 3,996 passed, 0 failed.
  • dotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-arm64 --no-restore -p:BuildProjectReferences=false --filter 'FullyQualifiedName~WorkspaceSessionLayoutTests' --verbosity normal: passed, 7 passed, 0 skipped or failed, using the already-built production references.
  • dotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-arm64 --no-build --no-restore --filter 'FullyQualifiedName~SidebarActionBackplates_AlignWithNavigationItems|FullyQualifiedName~SettingsChrome_SearchAndBidirectionalHistory_StayBelowNativeTitle' --verbosity normal: passed, 4 passed, 0 skipped or failed.
  • Baseline comparison: dotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-arm64 --no-build --no-restore --filter 'FullyQualifiedName~PaneToggle_LeavesRoundingRoomAroundUnconstrainedGlyph' --verbosity normal, with OPENCLAW_REPO_ROOT pointing to an exported copy of the original window markup: 3 expected failures on insufficient rounding clearance.

Real Behavior Proof

  • Environment tested: Windows ARM64, native WinUI, 125% rasterization scale, Light and Dark themes, isolated test profiles.
  • PR head or commit tested: the unchanged source content committed as 2bcb1b5d53354ef8ba071479a8d712fe6c7836c2; validation was collected before committing.
  • Exact steps or command run: the focused layout and real-app commands above. Separately rebuilt and launched .\run-app-local.ps1 -NoBuild -Isolated -AllowNonMain -Wait for manual inspection; its new profile opened Setup, which is not itself sidebar proof.
  • Evidence after fix: copied native test output:
Passed OpenClaw.Tray.UITests.WorkspaceSessionLayoutTests.PaneToggle_LeavesRoundingRoomAroundUnconstrainedGlyph(file: "HubWindow.xaml", name: "NavPaneToggleButton")
Passed OpenClaw.Tray.UITests.WorkspaceSessionLayoutTests.PaneToggle_LeavesRoundingRoomAroundUnconstrainedGlyph(file: "WorkspaceWindow.xaml", name: "ReopenPaneButton")
Passed OpenClaw.Tray.UITests.WorkspaceSessionLayoutTests.PaneToggle_LeavesRoundingRoomAroundUnconstrainedGlyph(file: "WorkspaceWindow.xaml", name: "CollapsePaneButton")
  • Observed result: complete toggle icon visible in the captured Light-theme Workspace; Light/Dark real-app checks passed. Mounted production controls preserve the unconstrained glyph dimensions and leave physical-pixel rounding clearance. The original markup fails the new clearance assertion with Glyph width 16 has no rounding room in content width 16 at raster scale 1.25.
  • Screenshot or artifact links verified? (Yes/No/N/A): N/A. Screenshots and logs remain local; relevant output is copied above.
  • Not verified or blocked: other display scales/resolutions, mixed-DPI monitor transitions, high-contrast mode, and Windows accessibility text scaling were not exercised. The baseline clearance failure is not a pixel-level reproduction of clipping at every scale. No manual verification result is claimed from the isolated Setup launch.

Security Impact

  • New permissions or capabilities? (Yes/No): No
  • Secrets or tokens handling changed? (Yes/No): No
  • New or changed network calls? (Yes/No): No
  • Command or tool execution surface changed? (Yes/No): No
  • Data access scope changed? (Yes/No): No
  • If any answer is Yes, explain the risk and mitigation: N/A

Compatibility and Migration

  • Backward compatible? (Yes/No): Yes
  • Config or environment changes? (Yes/No): No
  • Migration needed? (Yes/No): No
  • If yes, list the exact upgrade steps: N/A

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

Keep the native WinUI subtle-button style while removing text-button padding from Workspace and Settings pane toggles. Add native layout and markup regression coverage and document the icon-only padding invariant.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3439bb57-3a0e-4b13-b579-25edeafbf01d
@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 9, 2026
@clawsweeper

clawsweeper Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

The PR removes text-button padding from Workspace and Settings sidebar toggles so their icons have room inside the existing targets.

Example: A user opens Workspace at 125% display scaling.

  • Before: The 16-DIP toggle glyph has only 16 DIPs of content width, leaving no rounding clearance.
  • After: The same 40-DIP button gives the complete glyph additional clearance.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The repair is narrow and correct, with useful native layout evidence but limited shared visual proof.
Proof confidence 🦐 gold shrimp (3/6) The collaborator-authored PR is outside the external-contributor proof gate. Supplied output demonstrates native mounted-toggle clearance at 125% scale; real-app checks support surrounding interactions, while the claimed visible glyph capture remains local.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Sidebar toggle icons can look cropped at fractional display scaling.
Reason: The repair restores room for the intended complete glyph with three local setters. The prior native navigation contributor supplies the area direction, and the patch preserves the established interaction contract.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main retains the cramped button layout, and the patch preserves native interaction behavior without introducing a concrete defect. Collaborator-authored work also falls under the keep-open guard.

Priority: P3
Reviewed head: 2bcb1b5d53354ef8ba071479a8d712fe6c7836c2

Before merge

None.

Findings

None.

Tests

  • Low-value test tests/OpenClaw.Tray.Tests/Presentation/WorkspaceNavigationTests.cs: PaneToggle_TargetAndGlyphSizesMatchAcrossPaneStates: Remove the added exact Padding="0" assertion: it pins the chosen implementation and duplicates the new native fit coverage; the pre-existing target-size checks can remain.
  • Missing end-to-end proof: A shared current-head capture of the actual Workspace and Settings toggle glyphs at 125% scale is absent; the baseline comparison demonstrates geometric clearance failure rather than visible pixel clipping.
Agent review details

How this fits together

Workspace hosts native chat navigation, while Settings provides companion configuration pages. Their sidebar buttons open and close navigation panes without replacing the displayed content.

flowchart TD
    A[User clicks sidebar toggle] --> B{Window}
    B --> C[Workspace toggle]
    B --> D[Settings toggle]
    C --> E[Native button with icon clearance]
    D --> E
    E --> F[Navigation pane opens or closes]
Loading

Technical review

Best possible solution:

Keep the narrow native-button repair without adding a custom template or changing pane ownership.

Do we have a high-confidence way to reproduce the issue?

Yes for insufficient layout clearance: the supplied native baseline run reports content width 16 for a 16-DIP glyph at raster scale 1.25. Pixel-level clipping itself was not independently reproduced.

Is this the best way to solve the issue?

Yes. Local padding overrides address the constrained content area while retaining the native template, target size, focus behavior, and existing pane handlers.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 037c17dcb581.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Karen: Raw commit 3a58bf3 adds src/OpenClaw.Tray.WinUI/Windows/WorkspaceWindow.xaml:204 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3a58bf34902f; files: src/OpenClaw.Tray.WinUI/Windows/WorkspaceWindow.xaml)

Review metrics

Metric Value Why it matters
Production and test footprint Production +3/-3 lines; tests +68; docs +3 Production size stays constant, and most added coverage measures native glyph fit.

Labels

Label changes:

  • add P3: This fixes visual clipping while preserving working navigation and existing interaction targets.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This fixes visual clipping while preserving working navigation and existing interaction targets.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Share the existing current-head Workspace and Settings toggle captures at 125% scale, with private information redacted.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

Reviewed October 9, 2026, 2:32 PM ET / 18:32 UTC.

@karkarl

karkarl commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

Global triage: HOLD_FOR_AUTHOR. Take confidence 10%; recommendation confidence 99%; effort small; risk high.

Reviewed exact head 2bcb1b5d5335. GitHub currently reports BLOCKED with 25 passing, 2 failing, and 0 pending checks. proof pools are declared. Durable automated signal: Codex review: needs maintainer review before merge..

Author: update from current main, resolve conflicts or branch-policy blockers, then rerun exact-head validation and request review.

This is a triage classification, not a merge action. No branch changes were made.

@karkarl karkarl added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 15, 2026
@karkarl

karkarl commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

CI investigation: the rerun is green on the unchanged head 2bcb1b5d53354ef8ba071479a8d712fe6c7836c2. No code change was needed for this failure.

The original UI job stopped at UIThreadProc: before bootstrap; it never logged bootstrap complete or completed a UI test. The five-minute inactivity watchdog terminated the test host. CI Gate then failed because the UI lane had failed. The interrupted-test sequence is not evidence that the sidebar layout assertions caused the hang; those new cases had not run. There is no dump establishing the deeper cause, so this is classified as a transient Windows App SDK/test-host startup hang rather than a confirmed product defect.

Reran the failed jobs with gh run rerun 37973657125 --repo openclaw/openclaw-windows-node --failed. Attempt 2 succeeded:

  • Functional UI: 19 passed.
  • Tray UI: 467 passed, 19 skipped, including all three new sidebar-toggle layout cases.
  • Accessibility: 23 passed.
  • CI Gate: passed.

Locally, the concurrent Markdown and Workspace layout selection also passed in six fresh ARM64 test hosts (19 cases per run). No timeout increases, skipped assertions, test retries in code, or workflow changes were added. Working tree remains clean.

@karkarl karkarl removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 15, 2026
@karkarl
karkarl merged commit 1270165 into main Oct 15, 2026
46 of 48 checks passed
@karkarl
karkarl deleted the karkarl-sidebar-button-scaling branch October 15, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant