feat(sessions): default filter to current app when entering session page

Navigate directly to the active app's sessions instead of showing all.
This commit is contained in:
Jason
2026-02-21 18:30:56 +08:00
parent 165af5eec4
commit c3f29a62d1
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -724,7 +724,7 @@ function App() {
);
case "sessions":
return <SessionManagerPage />;
return <SessionManagerPage key={activeApp} appId={activeApp} />;
case "workspace":
return <WorkspaceFilesPanel />;
case "openclawEnv":
@@ -48,7 +48,7 @@ import {
type ProviderFilter = "all" | "codex" | "claude" | "opencode" | "openclaw";
export function SessionManagerPage() {
export function SessionManagerPage({ appId }: { appId: string }) {
const { t } = useTranslation();
const { data, isLoading, refetch } = useSessionsQuery();
const sessions = data ?? [];
@@ -63,7 +63,9 @@ export function SessionManagerPage() {
const searchInputRef = useRef<HTMLInputElement | null>(null);
const [search, setSearch] = useState("");
const [providerFilter, setProviderFilter] = useState<ProviderFilter>("all");
const [providerFilter, setProviderFilter] = useState<ProviderFilter>(
appId as ProviderFilter,
);
const [selectedKey, setSelectedKey] = useState<string | null>(null);
// 使用 FlexSearch 全文搜索