fix(ui): document viewer back button returns to the page you came from (chat or sources)

This commit is contained in:
2026-08-22 15:26:43 -04:00
parent 8ca564cd83
commit 2485b50af0
6 changed files with 287 additions and 31 deletions
+3 -2
View File
@@ -98,12 +98,13 @@ def test_on_topic_question_streams_grounded_answer(
# Grounded: a kubernetes.md source chip renders under the bubble
# (top-N docs can add more chips; the question's doc must be among them).
# Phase 10: chips open the document viewer in a new tab (encoded URL).
# Phase 10: chips open the document viewer in a new tab (encoded URL);
# phase 13 appends back=/ so the viewer's back button returns to chat.
chip = page.locator(".msg.brain .source-chip", has_text="kubernetes.md")
expect(chip).to_have_count(1)
expect(chip.first).to_contain_text("kubernetes.md")
expect(chip.first).to_have_attribute(
"href", "/document.html?source=docs&path=homelab%2Fkubernetes.md"
"href", "/document.html?source=docs&path=homelab%2Fkubernetes.md&back=%2F"
)
expect(chip.first).to_have_attribute("target", "_blank")
expect(chip.first).to_have_attribute("rel", "noopener")