Skip to content

fix(onboarding): make Stay Awake step cross-platform, not macOS-only - #347

Merged
chaitanyagiri merged 1 commit into
HarnessMD:mainfrom
devrahulbanjara:fix/cross-platform-power-settings-onboarding
Sep 6, 2026
Merged

chaitanyagiri merged 1 commit into
HarnessMD:mainfrom
devrahulbanjara:fix/cross-platform-power-settings-onboarding

Conversation

@devrahulbanjara

Copy link
Copy Markdown
Contributor

The permissions step's "Stay awake on power" panel hardcoded macOS copy ("macOS only lets you...", Battery -> Options steps) and a macOS-only deep link (x-apple.systempreferences:...), which the main process's openExternal allowlist also only permitted. On Windows this sent users to a "no app can open this link" dialog instead of Settings.

Derive the OS from window.cth.platform (already exposed by preload) and branch the copy, deep link, and button per platform: macOS opens the Battery pane, Windows opens ms-settings:powersleep (now allowed by the main-process allowlist), and Linux shows text-only guidance since there's no universal settings URI across desktop environments. Also generalized adjacent copy that assumed macOS ("Mac" -> "computer", "macOS asks permission" -> "your system may ask permission") across all three locales (en, ar, zh-CN).

What & why

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Docs
  • Build / CI

Evidence

Before

After

How I tested it

  • OS:
  • Steps:

Discord (optional)

Discord:

Checklist

  • Before and after evidence is attached above, under both headings.
  • npm run typecheck passes.
  • npm run test:focused passes.
  • npm run build succeeds.
  • This PR is one change. Unrelated fixes belong in their own PR.
  • I read the diff myself before opening this, and there is no debug output,
    commented-out code, or unrelated formatting churn in it.
  • Any new UI derives from DESIGN.md / tokens.ts — no ad-hoc colors,
    spacing, or fonts.
  • If I added art, it's my own or compatibly licensed, and listed in
    ATTRIBUTION.md.

The permissions step's "Stay awake on power" panel hardcoded macOS
copy ("macOS only lets you...", Battery -> Options steps) and a
macOS-only deep link (x-apple.systempreferences:...), which the main
process's openExternal allowlist also only permitted. On Windows this
sent users to a "no app can open this link" dialog instead of Settings.

Derive the OS from window.cth.platform (already exposed by preload)
and branch the copy, deep link, and button per platform: macOS opens
the Battery pane, Windows opens ms-settings:powersleep (now allowed
by the main-process allowlist), and Linux shows text-only guidance
since there's no universal settings URI across desktop environments.
Also generalized adjacent copy that assumed macOS ("Mac" -> "computer",
"macOS asks permission" -> "your system may ask permission") across
all three locales (en, ar, zh-CN).
Copilot AI lite review requested due to automatic review settings August 27, 2026 03:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

🚫 This PR is missing its before/after evidence

Every pull request here has to show its work. Screenshots or a short screen recording, before the change and after it.

  • Before — no image or video under that heading
  • After — no image or video under that heading

How to fix it: edit the description, keep the ### Before and ### After headings from the template, and drag an image or video under each. GitHub uploads it inline. This check re-runs the moment you save.

A bug fix with no visible surface still needs it: show the failing behaviour, then the same steps passing. A terminal recording is fine.

Genuinely nothing to show — a CI tweak, a typo, a dependency bump? A maintainer can apply the no-visual-change label. Please don't ask unless it truly has no observable effect.

📖 CONTRIBUTING.md → Evidence is mandatory

mrlfarano added a commit to mrlfarano/munder-difflin that referenced this pull request Aug 31, 2026
@chaitanyagiri

Copy link
Copy Markdown
Collaborator

Reviewed by an agent on the Munder Difflin hive floor, posted from @chaitanyagiri.
First person statements below are the agent's, including the scope limits.
Replies here are read. Questions in this comment are real questions.
Base: origin/main at 956bfb4.


Driving the copy and the button off window.cth.platform instead of hardcoding macOS is right,
and hiding the button entirely on Linux rather than deep-linking something that does not exist is
the honest version. All three locale files on origin/main at 956bfb4c are updated, ar, en and
zh-CN, so nothing is left behind today.

The thing to watch is the interaction with the other two locale PRs, because the keys were
RENAMED and not added alongside.
stayAwakeDesc becomes stayAwakeDescMac / Windows /
Linux, and openBattery becomes openBatteryMac / openBatteryWindows. #360 adds pt-PT and
pt-BR, and #361 moves a large number of hardcoded strings into the locales. Whichever of those
lands first will carry the OLD key names, and this PR will not touch them, so Portuguese gets the
key string or an English fallback on that panel with nothing failing. Worth a note in whichever
of the three merges second.

The IPC change widens the app:openExternal allowlist to ms-settings:. Same class of scheme as
the macOS one already there, still an allowlist, still anchored at the start of the string. No
concern, and the comment now names all three cases including why Linux has none, which is the part
that would otherwise read as an oversight.

One small thing: the keys are now built by interpolation,
t(\onboarding.permissions.stayAwakeDesc${...}`)`. Any tool that extracts keys statically will
stop seeing these five. If nothing in the repo does that, ignore this.

@chaitanyagiri
chaitanyagiri merged commit 3b8045e into HarnessMD:main Sep 6, 2026
1 check failed
crottolo added a commit to singleflo/munder-difflin that referenced this pull request Sep 15, 2026
Rebasing onto main brought 146 commits, and two of them moved ground the
Italian locale was standing on.

HarnessMD#347 made the Stay Awake step cross-platform: stayAwakeDesc became three
per-OS strings and the surrounding copy stopped saying "your Mac". The key
tree still matched on three of those, so nothing failed — the Italian simply
told a Windows user their Mac would sleep. reliabilityDesc, keepAwakeDesc and
notificationsDesc now say computer and system, like the English does. The Mac
variant is the old string unchanged, so it carries over verbatim; Windows and
Linux name the panels those systems actually ship in Italian rather than
translating the English ones literally.

HarnessMD#415 stopped hiding engines that cannot drain hive mail and shows them as
disabled rows instead, which needed a badge and a reason in every locale.

Also picks up the token-limit wording, which now spells out that cache reads
do not count against the limit.

zh-CN and ar came with those changes already; it.json is the only locale that
was not in main to receive them.
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.

3 participants