Skip to content

Deactivate Cards toggle when card dismissed via swipe-down#71

Merged
ProLoser merged 4 commits intomainfrom
copilot/update-setting-flag-on-swipe-down
Apr 19, 2026
Merged

Deactivate Cards toggle when card dismissed via swipe-down#71
ProLoser merged 4 commits intomainfrom
copilot/update-setting-flag-on-swipe-down

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

  • Update the touchend handler so downward swipe also disables card mode
  • Refactor updateCardToggleButton to accept optional enabled argument and internalize cardModeEnabled mutation + localStorage persistence
  • Move showEventCard/hideEventCard calls inside updateCardToggleButton; remove them from callers
  • updateCardToggleButton now always requires an argument (init call passes cardModeEnabled explicitly)

Copilot AI changed the title [WIP] Update setting flag when swiping down on cards Deactivate Cards toggle when card dismissed via swipe-down Apr 19, 2026
Copilot AI requested a review from ProLoser April 19, 2026 19:57
Comment thread map.js Outdated
hideEventCard();
cardModeEnabled = false;
localStorage.setItem('cardMode', false);
updateCardToggleButton();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot Seems like updateCardToggleButton should do most of this stuff (maybe taking an argument) instead of being called after mutations are made to reflect the changes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in a970a9e. updateCardToggleButton now accepts an optional enabled argument — when provided it sets cardModeEnabled and persists to localStorage before updating the button. Both the swipe-down path and the toggle-click handler now just call updateCardToggleButton(value) with no external mutations.

@ProLoser
Copy link
Copy Markdown
Owner

@copilot updateCardToggleButton should call show/hide and probably should never be called without an argument

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 19, 2026

@copilot updateCardToggleButton should call show/hide and probably should never be called without an argument

Done in bfdc58f. updateCardToggleButton now always requires an argument and internally calls showEventCard/hideEventCard. The swipe-down handler, toggle click handler, and init call are all simplified — callers just pass the desired boolean and let the function handle everything.

@ProLoser ProLoser marked this pull request as ready for review April 19, 2026 20:10
@ProLoser ProLoser merged commit c728787 into main Apr 19, 2026
@ProLoser ProLoser deleted the copilot/update-setting-flag-on-swipe-down branch April 19, 2026 20:12
@github-actions
Copy link
Copy Markdown

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-04-19 20:12 UTC

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.

Swiping down on the cards should also update the setting flag

2 participants