Skip to content

fix(webui): navigation fixes#3122

Merged
lidel merged 13 commits intoipfs:mainfrom
RubenKelevra:pr/navigation-fixes
Apr 28, 2026
Merged

fix(webui): navigation fixes#3122
lidel merged 13 commits intoipfs:mainfrom
RubenKelevra:pr/navigation-fixes

Conversation

@RubenKelevra
Copy link
Copy Markdown
Contributor

This stack of changes is thematically all navigation fixes (from the previous PRs combined).

This fixes:

  • First click navigation not working, and instead refreshing the status page
  • Navigation in the UI -> closing window -> selecting tray navigation item opening the UI, but not navigating
  • Application opening on a blank status page
  • Navigation with tray menu navigation items sometimes not working properly after UI navigation
  • ipfsd reload messing up the UI (can't remember what was happening in this case)
  • duplicate url loads on duplicate selections of the same item
  • Focus not properly set to the UI on restore
  • -3 errors in the log
  • Broken error logging if value is not an error object (are now logged as "unknown error")

Testing

I can only test on Linux, and I tested the core functionality of the app with Electron 39.5.1.

Drop the legacy double-load workaround from ipfs#1853.

Related commits in this branch address the #/blank routing race, so navigation can stay single-pass.
Use main-window visibility events for blank and restore routing, and align loadURL dedupe with the current WebUI URL before skipping navigation.
Try to focus WebUI contents on window show to keep keyboard interaction consistent after reopen.
Apply explicit tray routes via in-page hash updates when the WebUI is already visible, with loadURL fallback, so tray path changes stay consistent with UI navigation state.
Move WebUI URLs off the '-' host and match by origin so internal hash navigation is not rewritten by host-splitting behavior.
Use the live WebUI URL when available before applying dedupe checks. This keeps reopen routing deterministic when cached navigation state is stale.
When auto-open is enabled, promote the startup hash to status once the API address is available. This prevents intermittent startup cases where the WebUI stays on blank.
@RubenKelevra RubenKelevra requested a review from a team as a code owner February 27, 2026 21:28
lidel added 3 commits April 28, 2026 19:12
restore the renderer-side `document.visibilitychange` listener that
catches full occlusion, macOS app-hide and Mission Control, and add
`minimize`/`restore` handlers on the main side. both feed the same
idempotent updater alongside the existing IPC signal, keeping the
HashRouter on `#/blank` whenever the user cannot see the window so the
bandwidth graph on Status and the peer list on Peers do not re-render.
flip isErrored as soon as the log listener sees a known fatal kubo
startup pattern, so the migration prompt swaps to the error/upgrade
template right away instead of waiting for ipfsd.start() to reject
(which on macos can take long enough that the user thinks the dialog
is stuck on the in-progress migration template).

introduces a module-level FATAL_KUBO_LOG_PATTERNS list so future fatal
patterns can be added in one place. seeded with the version-mismatch
error that triggers the "Download latest release" upgrade dialog.
@lidel lidel changed the title WebUI: Navigation fixes fix(webui): navigation fixes Apr 28, 2026
Copy link
Copy Markdown
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Approach checks out. Thank you for fixing this annoying "initial state" bug where one had to click twice to load Status 👍

Pushed two commits on the branch:

  • ee80bd4 fix(webui): blank also on minimize and occlusion
    The new visibility flow only listens to BrowserWindow 'show'/'hide', which don't fire on user minimize, OS-level occlusion, or macOS app-hide (Cmd+H) / Mission Control, so the WebUI keeps re-rendering when the user can't see it. Restored the renderer-side document.visibilitychange listener alongside the IPC one (both feed the same idempotent updater) and added 'minimize'/'restore' handlers in main. Comments call out that the goal is to avoid re-rendering the bandwidth graph on Status and the peer list on Peers so hopefully future LLMs won't miss this.

  • af50a78 fix(daemon): detect fatal kubo errors in listener
    Bundled to address the macOS upgrade-dialog e2e flake (reproduces on main). Root cause: ipfsd.start() rejects too slowly for the test's 45s budget, so the prompt stays on the in-progress template. Added FATAL_KUBO_LOG_PATTERNS so the listener flips isErrored directly from the version-mismatch line and the upgrade template loads without waiting.

@lidel lidel merged commit c836158 into ipfs:main Apr 28, 2026
7 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.

2 participants