Skip to content

[ZEPPELIN-6423] Reload note when switching notebooks in the Angular UI#5259

Open
tbonelee wants to merge 1 commit into
apache:masterfrom
tbonelee:fix/notebook-reload-on-note-switch
Open

[ZEPPELIN-6423] Reload note when switching notebooks in the Angular UI#5259
tbonelee wants to merge 1 commit into
apache:masterfrom
tbonelee:fix/notebook-reload-on-note-switch

Conversation

@tbonelee
Copy link
Copy Markdown
Contributor

What is this PR for?

Navigating between notes in the Angular UI changed the URL but left the page showing the previously opened note.

The note fetch in NotebookComponent was bound only to the WebSocket connectedStatus$ stream (introduced in ZEPPELIN-6387). Because Angular reuses NotebookComponent across :noteId route changes — so ngOnInit does not re-run — and the WebSocket stays connected, selecting another note from the header notebook list never re-fetched the note. The URL/route params updated, but getNote() was never called for the new noteId, so the page kept rendering the old note.

This PR drives the fetch from a combineLatest of the connection status and the route params, so it fires on both a WebSocket (re)connect and a noteId/revisionId change. The reconnect-reload behavior from ZEPPELIN-6387 is preserved; distinctUntilChanged on the connection stream avoids a redundant fetch on init.

What type of PR is it?

Bug Fix

Todos

  • Re-fetch the note on noteId/revisionId route changes
  • Preserve WebSocket reconnect-reload behavior
  • Add e2e regression test

What is the Jira issue?

How should this be tested?

  • Automated: zeppelin-web-angular/e2e/tests/notebook/main/notebook-navigation.spec.ts opens one note, then navigates to a second note via the header "Notebook" dropdown and asserts the displayed note title (not just the URL) updates. Verified failing before the fix and passing after, against a live backend.
  • Manual:
    1. Open a notebook.
    2. From the header Notebook dropdown, click a different note.
    3. The page content should switch to the newly selected note (previously it stayed on the old note while the URL changed).

Screenshots (if appropriate)

N/A

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

The note fetch was bound only to the WebSocket connectedStatus$ stream.
Navigating between notes reuses NotebookComponent (ngOnInit does not
re-run) and keeps the socket connected, so selecting another note from
the header list changed the URL but never re-fetched the note - the page
kept showing the previously loaded note.

Drive the fetch from a combineLatest of the connection status and the
route params so it fires on both WebSocket (re)connect and
noteId/revisionId changes, preserving the reconnect-reload behaviour
from ZEPPELIN-6387.

Add an e2e regression test that opens one note and navigates to another
via the header notebook list, asserting the displayed note content
updates and not just the URL.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Assisted-By: Claude <noreply@anthropic.com>
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