fix(workspace): preserve query params during sidebar and database navigation
Use URLSearchParams to merge new params instead of replacing the full URL.
This commit is contained in:
parent
7dd38c185c
commit
5b87256cac
@ -216,7 +216,9 @@ function WorkspaceSection({ tree, onRefresh }: { tree: TreeNode[]; onRefresh: ()
|
||||
const handleSelect = useCallback((node: TreeNode) => {
|
||||
// Navigate to workspace page for actionable items
|
||||
if (node.type === "object" || node.type === "document" || node.type === "file" || node.type === "database" || node.type === "report") {
|
||||
window.location.href = `/?path=${encodeURIComponent(node.path)}`;
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
params.set("path", node.path);
|
||||
window.location.href = `/?${params.toString()}`;
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
||||
@ -170,7 +170,9 @@ export function DuckDBMissing() {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
window.location.href = "/?send=" + encodeURIComponent("install duckdb");
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
params.set("send", "install duckdb");
|
||||
window.location.href = `/?${params.toString()}`;
|
||||
}}
|
||||
className="flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors cursor-pointer"
|
||||
style={{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user