Skip to content

Commit 291a727

Browse files
SharonStratsGPT-5.6 Luna
andcommitted
Refreshing browse.html - do not redirect
Prompt: when on browse.html the user gets redirected to localhost:3100/storare Co-authored-by: GPT-5.6 Luna <gpt-5.6-luna@openai.com>
1 parent 9c97022 commit 291a727

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎docs/navigation-design.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ navigation controller, which always applies the same follow-up effects.
5353
mashlib. Those callers rely on it to push the history entry and the URL, so it is the one place that
5454
writes history, and it announces what it did.
5555

56+
Standalone shells such as `browse.html` can pass `preserveUrl: true` in the seventh argument when
57+
they display a subject while keeping their own document URL (the subject is carried in the shell's
58+
query parameters). This is intentionally opt-in; ordinary `GotoSubject` callers continue to make
59+
the displayed subject the page URL.
60+
5661
Storage is an explicit browser view, not a resource's default pane. Its pane item
5762
renders the storage root with `solo` and `fullView` disabled, so the storage
5863
header, sidebar and listing remain visible even if the root has an index document.

‎src/navigation/options.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export type FolderView = 'explorer' | 'storage' | 'container'
1717
export interface GotoSubjectOptions {
1818
source?: NavigationSource
1919
folderView?: FolderView
20+
/** Keep the caller's document URL while displaying a different subject. */
21+
preserveUrl?: boolean
2022
}
2123

2224
/** The folder view a `GotoSubject` caller asked for, if any. */

‎src/outline/manager.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,8 @@ export default function (context) {
19391939
solo &&
19401940
dom &&
19411941
dom.defaultView &&
1942-
dom.defaultView.history
1942+
dom.defaultView.history &&
1943+
!(options && typeof options === 'object' && options.preserveUrl === true)
19431944
) {
19441945
const currentState = dom.defaultView.history.state || {}
19451946
const leavingPage = document.location.href !== subject.uri

0 commit comments

Comments
 (0)