Skip to content

Conversation

@mikejoseph23
Copy link

Implements automatic reloading of unmodified markdown files when they change on disk, with a green success notification that auto-dismisses after 5 seconds with a countdown timer.

Changes:

  • Added 'autoReloadUnmodifiedFiles' preference (default: true) in new Experimental section
  • Created Experimental preferences UI component with beaker icon
  • Modified file change detection to auto-reload unmodified files
  • Enhanced notification system to support auto-hide with countdown timer
  • Green success notification shows "Document automatically reloaded from disk (5s)"
  • Blue confirmation prompt for modified files remains unchanged (no auto-dismiss)
  • Fixed pushTabNotification to properly pass autoHide properties

Implements automatic reloading of unmodified markdown files when they change
on disk, with a green success notification that auto-dismisses after 5 seconds
with a countdown timer.

Changes:
- Added 'autoReloadUnmodifiedFiles' preference (default: true) in new Experimental section
- Created Experimental preferences UI component with beaker icon
- Modified file change detection to auto-reload unmodified files
- Enhanced notification system to support auto-hide with countdown timer
- Green success notification shows "Document automatically reloaded from disk (5s)"
- Blue confirmation prompt for modified files remains unchanged (no auto-dismiss)
- Fixed pushTabNotification to properly pass autoHide properties
@mikejoseph23
Copy link
Author

Testing Instructions

Setup

  1. Build and install the application from this branch
  2. Open a markdown file in MarkText

Test Case 1: Auto-reload unmodified files (green notification)

  1. Open a markdown file without making any changes
  2. Using an external editor (e.g., VS Code, vim), modify the file and save it
  3. Expected: Green notification appears saying "Document automatically reloaded from disk (5s)"
  4. Expected: The notification should auto-dismiss after 5 seconds with a countdown timer
  5. Expected: The file content should be automatically reloaded

Test Case 2: Modified files prompt (blue notification)

  1. Open a markdown file and make some changes (do NOT save)
  2. Using an external editor, modify the same file and save it
  3. Expected: Blue notification appears asking "Do you want to reload it?" with an OK button
  4. Expected: This notification should NOT auto-dismiss (stays until you click OK or X)
  5. Click OK to reload or X to dismiss

Test Case 3: Experimental preferences UI

  1. Open Preferences (MarkText > Preferences on Mac)
  2. Navigate to the new "Experimental" section (should have a beaker/flask icon)
  3. Expected: See the "Automatically reload unmodified documents when changed on disk" toggle
  4. Expected: The toggle should be ON by default
  5. Toggle it OFF and repeat Test Case 1
  6. Expected: Blue confirmation prompt should appear instead of auto-reload

Test Case 4: Countdown timer

  1. With the feature enabled, trigger an auto-reload (Test Case 1)
  2. Expected: The countdown should display "(5s)" and count down: "(4s)" → "(3s)" → "(2s)" → "(1s)" → dismiss
  3. Click the X button before the countdown expires
  4. Expected: Notification should dismiss immediately and countdown should stop

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