Skip to content

Conversation

@udaign
Copy link

@udaign udaign commented Jan 21, 2026

Now you can also terminate the refresh at any point with a new "Stop Refresh" nav element, and a "Stop" button when on the settings overlay.

feat: Add "Refresh on Start" toggle and "Cancel Refresh" functionality

Description

This PR introduces two key features to improve user control over feed updates: a new setting to toggle automatic refreshing on application startup, and the ability to cancel an ongoing refresh operation from both the navigation bar and the settings overlay. The motivation behind these changes is the blockage of UI during refresh, which can take a long time depending on the source library.

Key Changes

1. Refresh on Start Toggle

  • Added a new "Refresh feeds on app start" toggle in Settings > Preferences.
  • Users can now opt-out of the immediate fetch upon launching the app. This is particularly useful for users with many feeds who want faster initial interactivity or are on metered connections.
  • Behavior: If disabled, the app skips the initial fetch but still initializes the automatic background fetch timer (setupAutoFetch), ensuring feeds will eventually update based on the configured interval.

2. Cancel Refresh Functionality

  • Navigation Bar:
    • The refresh button now changes to a "Cancel" (cross) icon while a fetch is in progress.
    • The rotation animation has been removed during fetching to indicate the button is interactive.
    • Clicking the button immediately terminates the fetch operation.
  • Settings Overlay:
    • Added a "Stop" button to the "Updating sources, please wait..." blocking overlay.
    • This resolves a UX friction point where users could be locked out of the Settings page during a long-running or stuck fetch operation.
  • Underlying Logic:
    • Implemented stopFetchItems action.
    • Refactored fetchItems to use Promise.race, allowing the fetch promise to be resolved early upon cancellation.
    • Partial results (items fetched before cancellation) are preserved and processed.

Technical Details

  • Backend: Added REFRESH_ON_START_STORE_KEY and IPC handlers to persist the new setting.
  • UI:
    • Updated Nav component to handle the cancel state and icon swapping.
    • Updated Settings component to include a DefaultButton in the loading overlay.
  • Localization: Added necessary strings to en-US.json.

Verification

  • Refresh on Start: Verified that disabling the toggle prevents the initial fetch on app launch, while enabling it restores the default behavior.
  • Nav Cancel: Verified that clicking the cross icon in the nav bar stops the fetch immediately.
  • Settings Stop: Verified that clicking "Stop" in the settings overlay dismisses the overlay and unblocks the UI.

…terminate the refresh at any point with a new stop refresh nav element, and a stop button on the settings overlay.
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.

1 participant