Skip to content

fix: refresh file associations when openers change - #647

Merged
AllTerrainDeveloper merged 2 commits into
WordPress:trunkfrom
Pranjal1423:fix/file-associations-live-refresh
Aug 22, 2026
Merged

AllTerrainDeveloper merged 2 commits into
WordPress:trunkfrom
Pranjal1423:fix/file-associations-live-refresh

Conversation

@Pranjal1423

@Pranjal1423 Pranjal1423 commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #588
This PR resolves the issue where new file opener registrations were not reflected in the File Associations settings tab dropdowns in real-time unless the user closed and reopened Preferences.

Changes:

  • src/desktop-files/settings-tab.ts: Subscribed the settings tab panel to changes in the file opener registry (subscribeOpeners). When a new opener is registered or unregistered, it triggers renderTab() to refresh the options in real-time. Added standard auto-cleanup to prevent duplicate subscriptions and memory leaks when the tab panel is disconnected from the DOM.

Testing:

  • Open Preferences -> File Associations.
  • Register a mock app in the console (window.wp.os.files.registerOpener(...)).
  • Check the dropdown list; the new app should immediately appear in the options without needing to reopen Preferences.

Before:

Screenshot 2026-08-21 at 6 30 08 PM

After:

Screenshot 2026-08-21 at 6 56 25 PM Open WordPress Playground Preview

@AllTerrainDeveloper AllTerrainDeveloper left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! You are the best!

@AllTerrainDeveloper
AllTerrainDeveloper merged commit c163f03 into WordPress:trunk Aug 22, 2026
6 checks passed
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.

New file openers do not appear until Preferences is reopened

2 participants