Repository navigation
fix: ask for notifications on first visit and keep the task after a session - #16
Merged
Merged
Conversation
…ession
## Summary
Two fixes from daily use.
**Ask for notifications on first visit.** A small banner ("Get a notification when a focus session or break ends") with **Allow** and a dismiss button appears the first time the app opens, while the browser has not asked yet. Allow opens the browser's permission dialog (browsers only show it after a click, which the banner provides). Dismiss hides it for good. If the browser dialog is closed without a choice, the banner stays to try again. Replaces the request that used to fire on the first Start Focus.
**Keep the task after a session.** Reset and the end of a break used to clear the focus goal, so continuing the same task meant typing it again. The goal now stays filled in; edit or clear it when you switch tasks.
## Testing
- Lint, typecheck, unit tests and build pass.
- Browser with a stubbed permission state: banner shows on first visit, Allow requests permission once and hides it.
- "Write chapter 3" stayed in the goal field after Reset, and after a 1-minute focus session plus a 1-minute break.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes from daily use.
Ask for notifications on first visit. A small banner ("Get a notification when a focus session or break ends") with Allow and a dismiss button appears the first time the app opens, while the browser has not asked yet. Allow opens the browser's permission dialog (browsers only show it after a click, which the banner provides). Dismiss hides it for good. If the browser dialog is closed without a choice, the banner stays to try again. Replaces the request that used to fire on the first Start Focus.
Keep the task after a session. Reset and the end of a break used to clear the focus goal, so continuing the same task meant typing it again. The goal now stays filled in; edit or clear it when you switch tasks.
Testing