[desktop] Add dismiss controls for default PDF app prompt#6100
[desktop] Add dismiss controls for default PDF app prompt#6100nickzerjeski wants to merge 7 commits intoStirling-Tools:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a less-intrusive, persisted “make Stirling PDF the default handler” banner flow for the desktop app, including a permanent opt-out and a settings-based re-enable path, as requested in #5772.
Changes:
- Implemented persisted dismissal + “Don’t ask again” + ~30-day reminder logic in the desktop default-app service.
- Updated the desktop default-app hook and banner to use the new prompt-visibility state and actions.
- Extended the shared
InfoBannerto support an optional secondary action button.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
frontend/src/desktop/services/defaultAppService.ts |
Adds localStorage-backed prompt suppression state, timestamps, and reminder-window logic. |
frontend/src/desktop/hooks/useDefaultApp.ts |
Exposes showPrompt / suppression state and new dismiss/reset actions to UI. |
frontend/src/desktop/components/shared/DefaultAppBanner.tsx |
Adds “Don’t ask again” action and switches visibility gating to showPrompt. |
frontend/src/desktop/components/shared/config/configSections/DefaultAppSettings.tsx |
Adds settings UI to re-enable the startup reminder when suppressed. |
frontend/src/core/components/shared/InfoBanner.tsx |
Adds optional secondary button props and rendering support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| const lastDismissedAt = this.getLastDismissedAt(); | ||
| if (lastDismissedAt === null) { | ||
| return true; |
There was a problem hiding this comment.
shouldShowPrompt() currently returns true when hasUserDismissedPrompt() is true but DISMISSED_AT_KEY is missing (lastDismissedAt === null). This creates an upgrade/migration regression: users who dismissed the banner in older versions (which only stored the boolean) will immediately see the prompt again after updating. Consider treating a missing timestamp as “dismissed recently” (e.g., set DISMISSED_AT_KEY to Date.now() and return false, or otherwise default to suppressing until the next reminder window).
| return true; | |
| // Migrate legacy dismissed state that predates timestamp storage: | |
| // treat it as a recent dismissal so the prompt is not shown again immediately. | |
| try { | |
| localStorage.setItem(DISMISSED_AT_KEY, Date.now().toString()); | |
| } catch (error) { | |
| console.error("[DefaultApp] Failed to persist dismissal timestamp:", error); | |
| } | |
| return false; |
There was a problem hiding this comment.
Implemented in commit b27841ab6.
shouldShowPrompt() now migrates legacy dismissed state (missing DISMISSED_AT_KEY) by storing Date.now() and returning false, so users who dismissed previously do not see the prompt immediately after upgrade.
|
Implemented a follow-up commit to address the review feedback:
Validation rerun:
All passed locally. |
🌐 TOML Translation Verification Summary🔄 Reference Branch:
|
|
I dont think having a setting to re-enable the remidner makes sense... I might have mis-spoken in issue ticket, there is no case a user would want to re-enable the reminder, only enable the feature itself if the user wants to enable the actual default app feature there should a button to do that (idk if there is outside of banner) |
|
Looks like we do already have the button in desktop mode so i guess we can just remove the other you added! sorry for that confusion |
|
@Frooodle done. I removed the settings-side reminder re-enable path/button as requested and kept only the existing default-app action path. Included in commit: df25bd4
|
Description of Changes
Implemented the desktop default-PDF-association banner flow requested in #5772.
What changed:
Don't ask againaction in the default app banner.Why:
Root cause addressed:
Validation performed:
npm run format:check(frontend) for changed filesnpm run prep:desktopnpm run typecheck:desktopCloses #5772
Checklist
General
Documentation
Translations (if applicable)
scripts/counter_translation.pyUI Changes (if applicable)
Testing (if applicable)