Skip to content

Desktop: optional "Support us on Ko-fi" tag (#403) - #456

Draft
Sebagrei wants to merge 1 commit into
mainfrom
feature/403-kofi-tag
Draft

Sebagrei wants to merge 1 commit into
mainfrom
feature/403-kofi-tag

Conversation

@Sebagrei

Copy link
Copy Markdown
Collaborator

Closes #403

What changed

  • Tag in the status bar: "Support us on Ko-fi" shows once per start of the desktop app. A click opens https://ko-fi.com/warr_ev in the system browser and hides the tag. The × button only hides it.

  • Once per start: the new command donate_tag_due (desktop/src/commands.rs) answers yes once per process. The flag is an AtomicBool in memory, so reconnecting, switching server or reloading the window does not show the tag again.

  • Fixed link: DONATE_URL is a constant, opened from Rust by open_donate_page, the same way open_release_page opens the release page. The web view cannot pass an address, and ko-fi.com is not in the CSP. Nothing is loaded, sent or counted before the click.

  • Settings switch: Settings → Support TeamCraft has a checkbox that turns the tag off. It is stored as donate_tag: Option<bool> in the settings file (#[serde(default)], so older files load unchanged). Command: set_donate_tag.

  • Policy: ShowDonateTag (0 = never shown, 1 = always shown, not set = the user chooses) is in desktop/src/policy.rs (struct, from_lookup, or, view().fixed → donate_tag, module table). When the policy is set, the Settings checkbox is disabled and shows Set by your organization. set_donate_tag is refused under the policy.

  • Policy templates: ShowDonateTag is added to the ADMX, the en-US and de-DE ADML, the macOS mobileconfig and the Linux policies.json.

  • i18n: new texts are in shared/i18n/en.json and de.json and are used through t(). No inline styles or scripts; the CSS is in desktop/ui/app.css.

  • Tests (Rust):

    • policy: parsing, wrong types, registry types, or precedence, fixed list;
    • settings: an old file without the field still loads, and the choice round-trips;
    • once-per-start rule;
    • fixed URL that is not in tauri.conf.json.

    There is no JS rule test, because the show/hide decision is in Rust.

  • CI fix: scripts/ci-changes.sh --self-test already failed on main. Its local-changes.js line expected desktop_rust=false, but scripts in desktop/ui/js match DESKTOP_RUST_ALSO. The line now expects true, and the self-test passes locally.

  • Docs: CHANGELOG, README, desktop/README, guide/desktop.md (new section Support us on Ko-fi), admin/desktop-deployment.md, admin/privacy.md, dev/threat-model.md, OPEN_WORK.md.

Not verified locally

This was not compiled or tested locally. Neither the desktop app nor the server was built, and Node.js was not available to run the UI checks. Only cargo fmt --check (desktop) and the ci-changes self-test were run. CI verifies the rest.

Left out / open

  • Web UI or server footer link: desktop only, as the issue scoped it.
  • The tag is also shown in with local server test installations. The issue left this open.
  • No settings-command test for set_donate_tag under a policy: the policy is a process-wide OnceLock, so the refusal rests on show_donate_tag.is_some(), which the policy tests cover.

🤖 Generated with Claude Code

Once per start of the app the status bar shows a small "Support us on
Ko-fi" tag. A click opens the fixed Ko-fi page (https://ko-fi.com/warr_ev)
in the system browser from Rust and hides it; x only hides it. Whether it
was shown is held in memory (donate_tag_due), so reconnecting, switching
server or reloading the window does not show it again.

Settings -> Support TeamCraft switches it off (donate_tag in the settings
file); the new desktop policy ShowDonateTag fixes it (ADMX, en-US and
de-DE ADML, macOS profile, Linux policies.json). Texts through the i18n
catalogs (English, German). Rust tests for the policy, the settings
field, the once-per-start rule and the fixed URL outside the CSP.

Also fixes the ci-changes.sh self-test line of local-changes.js, which
expected desktop_rust=false although desktop/ui/js scripts run the
desktop Rust tests.

Docs: CHANGELOG, README, desktop/README, guide/desktop.md,
admin/desktop-deployment.md, admin/privacy.md, dev/threat-model.md,
OPEN_WORK.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Desktop: optional "Support us on Ko-fi" tag, shown once per start, switchable in Settings and by policy

1 participant