mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-17 18:38:57 +08:00
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:
+1
-1
@@ -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 全文搜索
|
||||
|
||||
Reference in New Issue
Block a user