Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(inbox): parse issue query param on initial page load

Naiyuan Qingc3cca50f2777
diff --git a/apps/web/app/(dashboard)/inbox/page.tsx b/apps/web/app/(dashboard)/inbox/page.tsx
index 65b3191b47..d2e8112b5b 100644
--- a/apps/web/app/(dashboard)/inbox/page.tsx
+++ b/apps/web/app/(dashboard)/inbox/page.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useState, useEffect, useCallback } from "react";
import { useSearchParams } from "next/navigation";
import { useDefaultLayout } from "react-resizable-panels";
import { useInboxStore } from "@/features/inbox";
@@ -219,11 +220,20 @@ function InboxListItem({
export default function InboxPage() {
const searchParams = useSearchParams();
- const selectedKey = searchParams.get("issue") ?? "";
- const setSelectedKey = (key: string) => {
+ const urlIssue = searchParams.get("issue") ?? "";
+
+ const [selectedKey, setSelectedKeyState] = useState(() => urlIssue);
+
+ // Sync from URL when searchParams change (e.g. Next.js navigation)
+ useEffect(() => {
+ setSelectedKeyState(urlIssue);
+ }, [urlIssue]);
+
+ const setSelectedKey = useCallback((key: string) => {
+ setSelectedKeyState(key);
const url = key ? `/inbox?issue=${key}` : "/inbox";
window.history.replaceState(null, "", url);
- };
+ }, []);
const items = useInboxStore((s) => s.dedupedItems());
const loading = useInboxStore((s) => s.loading);