summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components
diff options
context:
space:
mode:
authorBrendan Allan <[email protected]>2026-03-05 14:41:12 +0800
committerGitHub <[email protected]>2026-03-05 14:41:12 +0800
commit7948de16129970ab01286fbbd7ba7a5e5dcf7be9 (patch)
tree936873d4f5048a7665ad4fcf9e21e404f1a8ea23 /packages/ui/src/components
parentf363904febd2134e8c73681e1b02cfb283e075a2 (diff)
downloadopencode-7948de16129970ab01286fbbd7ba7a5e5dcf7be9.tar.gz
opencode-7948de16129970ab01286fbbd7ba7a5e5dcf7be9.zip
app: prefer using useLocation instead of window.location (#15989)
Diffstat (limited to 'packages/ui/src/components')
-rw-r--r--packages/ui/src/components/message-part.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsx
index aecdbc8e4..766060f1b 100644
--- a/packages/ui/src/components/message-part.tsx
+++ b/packages/ui/src/components/message-part.tsx
@@ -52,6 +52,7 @@ import { TextShimmer } from "./text-shimmer"
import { AnimatedCountList } from "./tool-count-summary"
import { ToolStatusTitle } from "./tool-status-title"
import { animate } from "motion"
+import { useLocation } from "@solidjs/router"
function ShellSubmessage(props: { text: string; animate?: boolean }) {
let widthRef: HTMLSpanElement | undefined
@@ -1471,6 +1472,7 @@ ToolRegistry.register({
render(props) {
const data = useData()
const i18n = useI18n()
+ const location = useLocation()
const childSessionId = () => props.metadata.sessionId as string | undefined
const title = createMemo(() => i18n.t("ui.tool.agent", { type: props.input.subagent_type || props.tool }))
const description = createMemo(() => {
@@ -1487,8 +1489,7 @@ ToolRegistry.register({
const direct = data.sessionHref?.(sessionId)
if (direct) return direct
- if (typeof window === "undefined") return
- const path = window.location.pathname
+ const path = location.pathname
const idx = path.indexOf("/session")
if (idx === -1) return
return `${path.slice(0, idx)}/session/${sessionId}`