the breadcrumb closes the pane too
Half a fix shipped last commit. Navigating by double-clicking a folder row closed
the open pane; navigating by clicking a BREADCRUMB did not — so the browser moved
and the viewer stayed, showing a file from a folder you had left. It failed to
load, because the name is now resolved against the folder in the path and the file
was not in this one.
The two do not share a code path. A row goes through `setCurrentPath`, which I
stripped. A crumb is a `<Link to={hrefForPath(...)}>` and never calls it — and
`hrefForPath` still carried `location.search` verbatim. Same navigation, two
outcomes, decided by which control you used.
Both strip now. Audited every site that builds a folder URL:
setCurrentPath strips — rows, search results, Show location
hrefForPath strips — breadcrumb links
legacy redirect KEEPS, deliberately: `?path=X&view=Y` is one old link meaning
"this folder, with that file open", and honouring it is the
whole point of the redirect
widget openFile sets its own view; the search it discards belongs to the screen
it is navigating away from
This is the third bug in a row from the same root — the query string having more
than one writer. The list of overlay params has an owner as of the last commit;
the ACTS that clear it still do not, which is why a `<Link>` could quietly opt out
of a rule the function next to it enforced.
tsgo clean, frontend builds, 840 pass / 7 fail unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -47,10 +47,17 @@ export const useFileBrowserApp = (basePath: string, rootOverride?: string, urlPa
|
||||
};
|
||||
|
||||
/**
|
||||
* Where a crumb points. A real `To` rather than a query string, because the folder is the pathname now;
|
||||
* the current search rides along so cmd-clicking a crumb keeps whatever is open.
|
||||
* Where a crumb points. A real `To` rather than a query string, because the folder is the pathname now.
|
||||
*
|
||||
* Drops the overlay, exactly as `setCurrentPath` does. A breadcrumb is a `<Link>` and never goes
|
||||
* through that function, so stripping it in one place and not the other meant clicking a folder row
|
||||
* closed the pane and clicking a crumb did not — the same navigation, two different outcomes,
|
||||
* depending on which control you used.
|
||||
*/
|
||||
const hrefForPath = (path: string) => ({ pathname: folderHref(path), search: location.search });
|
||||
const hrefForPath = (path: string) => ({
|
||||
pathname: folderHref(path),
|
||||
search: withoutViewerParams(location.search),
|
||||
});
|
||||
|
||||
/**
|
||||
* The ephemeral viewer params replace each other wholesale: opening a file closes whatever overlay was
|
||||
|
||||
Reference in New Issue
Block a user