Add localStorage-based dismissal for donation dialog#709
Merged
Conversation
Co-authored-by: ManAnRuck <2183135+ManAnRuck@users.noreply.github.com>
… parseInt Co-authored-by: ManAnRuck <2183135+ManAnRuck@users.noreply.github.com>
Co-authored-by: ManAnRuck <2183135+ManAnRuck@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement functionality to hide donation dialog based on user interaction
Add localStorage-based dismissal for donation dialog
Nov 4, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR adds localStorage-based dismiss functionality to the DonateDialog component. The dialog will now remember when users dismiss it and respect configurable time periods before showing again (30 minutes for "Not Now", 1 day for "Donate").
Key Changes:
- Created a new utility module (
donateDialogStorage.ts) to manage dialog dismiss state using localStorage - Updated
DonateDialogcomponent to check localStorage before showing the dialog - Added dismiss time tracking when users interact with dialog buttons
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
democracy/desktop/src/utils/donateDialogStorage.ts |
New utility module providing functions to check and set dialog dismiss timestamps with error handling for localStorage operations |
democracy/desktop/src/components/organisms/DonateDialog.tsx |
Updated to use localStorage utilities, changed from useMemo to useEffect, and added dismiss time tracking on button clicks |
ManAnRuck
approved these changes
Nov 4, 2025
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.
The donation dialog "Wir brauchen Dich! 🫵🏼" was appearing on every page refresh. Implemented time-based dismissal with localStorage persistence.
Changes
New utility module (
donateDialogStorage.ts)shouldShowDonateDialog(): Checks localStorage for active dismissal periodsetDonateDialogDismissTime(): Persists dismissal timestampUpdated DonateDialog component
useEffectBehavior
If localStorage is unavailable or throws, dialog shows normally (fail-open pattern).
Original prompt
Start implementation
User has selected text in file devbox.json from 2:17 to 2:21
[Chronological Review: The conversation began with the user requesting a functionality to hide a donation dialog for a specified duration based on user interaction. The user specified that the dialog should not be shown again for 30 minutes if the user clicks "jetzt nicht" (not now) and for one day if they click "spenden" (donate). The user then clarified that if the settings are set to hide, the popup should not be visible and should not trigger any flicker. They also mentioned that if there is no local storage, the dialog should always be shown. The user decided to use browser developer tools for testing instead of other methods. The conversation continued with the user requesting to skip showing the dialog when it should be hidden, and finally, they instructed to start the implementation.]
[Intent Mapping:
[Technical Inventory:
[Code Archaeology: No specific files or code changes have been discussed yet, as the user has just initiated the implementation phase.]
[Progress Assessment:
[Context Validation: All critical information for continuation is captured, including user requirements for the donation dialog and the conditions under which it should be displayed or hidden.]
[Recent Commands Analysis:
1. Conversation Overview: - Primary Objectives: User requested to implement functionality to hide the donation dialog for specific durations based on user interactions: "Wir brauchen Dich! 🫵🏼" should not be shown again for 30 minutes if "jetzt nicht" is clicked and for one day if "spenden" is clicked. - Session Context: The conversation flowed from outlining requirements to clarifying behavior under certain conditions, leading to the initiation of the implementation phase. - User Intent Evolution: The user clarified their requirements and testing methods, ultimately directing to start the implementation.- Technical Foundation:
- Local Storage: Used to store user preferences regarding the donation dialog visibility.
- Popup Dialog: The UI element that needs to be controlled based on user actions.
- Codebase Status:
- No specific files or code changes have been discussed yet, as the implementation has just been initiated.
- Problem Resolution:
- Issues Encountered: None reported yet, as the implementation phase has just started.
- Solutions Implemented: Not applicable at this stage.
- Debugging Context: No ongoing troubleshooting efforts reported.
- Lessons Learned: User has specific requirements for dialog visibility based on interactions.
- Progress Tracking:
- Completed Tasks: User has defined the requirements for the donation dialog functionality.
- Partially Complete Work: Implementation has just started, with no code changes made yet.
- Active Work State:
- Current Focus: User is focused on starting the implementation of the donation dialog functionality.
- Recent Context: The last few exchanges involved clarifying requirements and initiating the implementation.
- Working Code: No specific code snippets have been discussed yet.
- Immediate Context: User requested to start the implementation of the donation dialog functionality.
- Recent...
Created from VS Code via the GitHub Pull Request extension.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.