Skip to content

Add a new section#10

Merged
twibster merged 2 commits into
mainfrom
feat/donate-tab
Apr 15, 2026
Merged

Add a new section#10
twibster merged 2 commits into
mainfrom
feat/donate-tab

Conversation

@twibster
Copy link
Copy Markdown
Owner

@twibster twibster commented Apr 15, 2026

Summary

  • New sidebar nav tab (Tag=4, Heart24 icon) with a matching content page, slotted between Settings and About in the bottom cluster of the sidebar.
  • Registers the new page in _pages so the existing NavButton_CheckedShowPage fade/slide flow picks it up automatically.
  • Adds a bundled PNG asset and a stripped-chrome Button template so a branded image renders as the button face without WPF's default button chrome repainting over it; hover/pressed feedback is done via Opacity on the outer Border so colours stay intact.
  • External URL launches go through Process.Start with UseShellExecute=true (.NET 8 requirement for https:// URLs); failures are swallowed so a missing default browser doesn't crash the UI.

Test plan

  • Release build is clean — 0 warnings / 0 errors
  • Sidebar order top-to-bottom: Home, Pinned, Settings, [new], About
  • Clicking the new tab fades in the content with the same 250ms slide-up as the existing tabs
  • Clicking the CTA button opens the target URL in the default browser
  • Keyboard: Tab reaches the new sidebar tab and the CTA; Space/Enter activates them
  • Screen reader announces the page title and the button's AutomationProperties.Name
  • Hover and press on the CTA show subtle opacity feedback without any WPF chrome overlay

New nav tab between Settings and About (Heart24 icon, Tag=4) opens a
dedicated page with a PayPal donate button — accent-filled Hyperlink
that ShellExecutes to paypal.me/omara2002 in the default browser.

Sidebar ordering note: DockPanel Bottom-docked children stack upward
from the bottom in XAML order, so About must remain first, Donate is
inserted between, and Settings stays last. Visual top-to-bottom in
the bottom cluster is Settings, Donate, About.
Use Ko-fi's official "Buy me a coffee" PNG (downloaded from Ko-fi's CDN,
bundled as a WPF Resource) instead of the PayPal text hyperlink. A plain
Button with a stripped ControlTemplate — just a Border wrapping a
ContentPresenter — makes the yellow branded image the button face with
no chrome repainting over it. Hover / pressed give subtle opacity
feedback so users still get "this is clickable" affordance.

KofiDonate_Click uses Process.Start with UseShellExecute=true to open
https://ko-fi.com/twibster in the default browser; .NET 8 requires the
shell-execute flag for https URLs. Any launch failure is swallowed — a
missing default browser shouldn't crash the UI, and the ToolTip already
shows the URL for manual copy.

Accessibility: Cursor=Hand, AutomationProperties.Name, and a descriptive
ToolTip cover mouse, keyboard, and screen-reader paths.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

📝 Walkthrough

Walkthrough

A new Donate page feature is being added to the ScreenSound application. Changes include registering a Ko-fi button image as a project resource, creating a Donate page UI with navigation in the main window XAML, extending page routing logic, and implementing a handler to open the Ko-fi donation URL in the user's default browser.

Changes

Cohort / File(s) Summary
Project Resources
ScreenSound.csproj
Added WPF resource entry for Ko-fi branded button image (Assets\kofi-button.png) with descriptive comments.
Main Window UI
ScreenSound/Views/MainWindow.xaml
Added new Donate page navigation RadioButton (Tag 4) in sidebar and a new DonatePage Border element containing a header with heart icon, donation description text, and a custom-templated Ko-fi button with hover/pressed opacity effects.
Page Routing & Event Handling
ScreenSound/Views/MainWindow.xaml.cs
Extended _pages array from 4 to 5 entries to include DonatePage at index 4; added KofiDonate_Click event handler that opens https://ko-fi.com/twibster via Process.Start with exception suppression.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hoppity-hop, a donation page appears,
A Ko-fi button brings such cheer!
With coffee cups and hearts so grand,
Supporting creators across the land,
A simple click, a link to share—
Twibster's dreams float on air! ☕❤️

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Add a new section' is vague and does not clearly indicate that the PR adds a Donate page with Ko-fi integration functionality. Consider a more specific title like 'Add Donate page with Ko-fi button' to clearly convey the main change.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/donate-tab

Comment @coderabbitai help to get the list of available commands and usage tips.

@twibster twibster self-assigned this Apr 15, 2026
@twibster twibster added the release:minor 0.X.0 release - new feature label Apr 15, 2026
@twibster twibster merged commit 505bd2d into main Apr 15, 2026
2 checks passed
@github-actions
Copy link
Copy Markdown

Released as v2.1.0.

@twibster twibster deleted the feat/donate-tab branch May 5, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:minor 0.X.0 release - new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant