Sync Behavior

Mosaic's reason for existing is that the three panes stay in sync. This page documents exactly what is and isn't kept in sync, and how the sync mechanisms work in practice.

Scroll sync

Scroll any pane and the other two follow. The sync uses two strategies in priority order:

  1. Anchor element. Mosaic finds an identifiable element near the top of the visible viewport in the source pane (preferring elements with id, data-testid, headings, or sectioning landmarks) and scrolls each other pane until that same element is in roughly the same position. This is robust against pages where the layout differs significantly between viewports - the scroll position lines up by content, not by pixel.
  2. Scroll percentage fallback. When no shared identifiable element is in the visible viewport (rare, but happens on pages with no semantic markup), Mosaic falls back to mapping the source pane's scroll percentage onto the other panes. This is less precise but always works.

The sync is broadcast in real time as you scroll - there's no debounce or visible lag. Rapid scrolling, programmatic scroll-into-view, and anchor-link clicks all trigger the same broadcast.

Click sync

Click any link or button in any pane. If the click triggers a navigation - in-page anchor jump, internal link, external link, form submit, or programmatic location.href assignment - the destination URL is broadcast to the other two panes and they navigate to it.

Sync is implemented via Chromium's did-navigate event on each WebContentsView. Whenever any pane fires did-navigate, Mosaic forwards the new URL to the other two panes. This catches:

Back and forward navigation

The toolbar has Back and Forward buttons. Clicking Back steps every pane backwards in its own history stack simultaneously. Each pane keeps its own independent history, but the buttons drive them together.

The buttons enable themselves once any pane has at least one navigation event in its history. They disable when no pane can go further in that direction. This means navigation buttons broadly track the global state: if any pane has somewhere to go back to, Back is enabled.

Shared session

All three panes use a single Chromium session partition: persist:mosaic-shared. This means cookies, localStorage, sessionStorage, IndexedDB, and Service Worker registrations are shared across panes.

The practical result: log in once and every pane is logged in. This makes Mosaic useful for:

The session persists across app restarts because the partition is prefixed persist:. To start fresh, see Cache & DevTools for the purge cache button - which clears HTTP cache only, not cookies. To clear cookies and storage, you'll currently need to do it via DevTools' Application tab in any pane.

What is not synced

Reload all

The toolbar reload button (or Cmd+R) reloads all three panes simultaneously while preserving the URL.

See also