Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useNavigate } from "@tanstack/react-router";
import { type ReactNode, useEffect } from "react";
import { useHotkey } from "renderer/hotkeys";
import { electronTrpc } from "renderer/lib/electron-trpc";
import { CommandContextProvider } from "./core/ContextProvider";
import { useFrameStackStore } from "./core/frames";
import { registerAllModules } from "./modules";
import { checkResourcesCommand } from "./modules/resources/commands";
import { CommandPalette } from "./ui/CommandPalette/CommandPalette";
import { DeleteWorkspaceMount } from "./ui/DeleteWorkspaceMount/DeleteWorkspaceMount";
import { FolderImportMount } from "./ui/FolderImportMount/FolderImportMount";
Expand Down Expand Up @@ -33,13 +33,13 @@ export function CommandPaletteHost({ children }: { children?: ReactNode }) {
function CommandPaletteTrigger() {
const setOpen = useFrameStackStore((s) => s.setOpen);
const reset = useFrameStackStore((s) => s.reset);
const pushFrame = useFrameStackStore((s) => s.pushFrame);
const navigate = useNavigate();
useHotkey("OPEN_COMMAND_PALETTE", () => setOpen(true));

const openResources = () => {
setOpen(true);
setOpen(false);
reset();
pushFrame(checkResourcesCommand);
void navigate({ to: "/usage/resources" });
};

// Keeps CHECK_RESOURCES on the renderer's own hotkey binding (rather than a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { HiOutlineCpuChip } from "react-icons/hi2";
import type { Command } from "../../core/types";
import { ResourcesFrame } from "../../ui/ResourcesFrame";

/**
* Provided by the actions module (ordering within the Actions section);
* also pushed directly by the CHECK_RESOURCES hotkey.
* Provided by the actions module (ordering within the Actions section); the
* CHECK_RESOURCES hotkey and the native "Resources" menu item navigate to the
* same page.
*/
export const checkResourcesCommand: Command = {
id: "resources.check",
Expand All @@ -23,5 +23,5 @@ export const checkResourcesCommand: Command = {
"activity",
"processes",
],
renderFrame: () => <ResourcesFrame />,
run: (context) => context.navigate("/usage/resources"),
};

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export const PERSISTED_KEY_REGISTRY: ReadonlyArray<
["desktop-notice-dismissals-v1", "v2-setup-card-dismissals-v1"],
],
["src/renderer/stores/workspace-agents-row.ts", ["workspace-agents-row"]],
[
"src/renderer/routes/_authenticated/_dashboard/usage/utils/usageLastSection/usageLastSection.ts",
["usage-last-section-v1"],
],
["src/renderer/stores/inline-workspace-ports.ts", ["inline-workspace-ports"]],
["src/renderer/hotkeys/stores/hotkeyOverridesStore.ts", ["hotkey-overrides"]],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ import {
tasksSearchFromFilters,
useTasksFilterStore,
} from "renderer/routes/_authenticated/_dashboard/tasks/stores/tasks-filter-state";
import {
getUsageLastSection,
usageSectionPath,
} from "renderer/routes/_authenticated/_dashboard/usage/utils/usageLastSection";
import { useHostWorkspaces } from "renderer/routes/_authenticated/providers/HostWorkspacesProvider";
import { STROKE_WIDTH_THICK } from "renderer/screens/main/components/WorkspaceSidebar/constants";
import {
Expand Down Expand Up @@ -166,7 +170,9 @@ export function DashboardSidebarHeader({
};

const handleUsageClick = () => {
navigate({ to: "/usage" });
// Reopen whichever Usage section (token / machine resources) was
// visited last.
navigate({ to: usageSectionPath(getUsageLastSection()) });
};

const handlePullRequestsClick = () => {
Expand Down
Loading
Loading