Skip to content

fix(ui): make Learn more text selectable/copyable - #55

Merged
carterscode merged 1 commit into
mainfrom
fix/learn-more-copyable
Jun 20, 2026
Merged

fix(ui): make Learn more text selectable/copyable#55
carterscode merged 1 commit into
mainfrom
fix/learn-more-copyable

Conversation

@carterscode

Copy link
Copy Markdown
Owner

Problem

In the Settings window, the per-setting Learn more expanders list copy-pasteable PowerShell commands (verify / apply / reverse), but the content was rendered in a plain TextBlock — which WPF does not allow you to select or copy. So there was no way to actually grab the commands and run them.

Fix

Render the Learn more content in a read-only, chrome-free TextBox via a shared CopyableLearnMoreText style. It looks identical to plain text but supports click-drag selection, Ctrl+A/Ctrl+C, and right-click → Copy.

  • Custom control template strips all TextBox chrome (border, background, focus underline) and disables its scrollbars so it renders like plain text and doesn't swallow mouse-wheel scrolling inside the settings ScrollViewer.
  • Applied to all 8 Learn more expanders (every tab's row template + the shared Debloat template).
  • Binding is Mode=OneWay (the source is a read-only property — avoids the TwoWay-to-readonly pitfall noted in the project's working notes).

Testing

  • dotnet build (incl. forced rebuild so the XAML markup compiler validated the new template) — clean, 0 warnings (TreatWarningsAsErrors).
  • dotnet test553 passed, 0 failed.
  • Pure presentation change (no logic); the WPF UI isn't unit-testable here (FluentWindow doesn't expose UIA patterns), so no new tests.

🤖 Generated with Claude Code

The Learn more expanders rendered their content (including the verify /
apply / reverse PowerShell commands) in a plain TextBlock, which WPF
doesn't allow you to select or copy. Render it instead in a read-only,
chrome-free TextBox via a shared CopyableLearnMoreText style — looks
identical to plain text but supports click-drag selection, Ctrl+A/Ctrl+C,
and right-click Copy, so users can paste the commands into a terminal.

The custom template strips all TextBox chrome (border, background, focus
underline) and disables its scrollbars so it doesn't swallow mouse-wheel
scrolling inside the settings ScrollViewer. Applied to all 8 Learn more
expanders (one per tab's row template). Binding is Mode=OneWay (the
source is a read-only property; avoids the TwoWay-to-readonly pitfall).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@carterscode
carterscode merged commit e2fdfe4 into main Jun 20, 2026
5 checks passed
@carterscode
carterscode deleted the fix/learn-more-copyable branch June 20, 2026 20:44
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