Skip to content

Commit 4bb8490

Browse files
authored
disable focus feature (#1310)
1 parent 12e0124 commit 4bb8490

File tree

1 file changed

+1
-76
lines changed

1 file changed

+1
-76
lines changed

apps/code/src/renderer/features/task-detail/components/ChangesPanel.tsx

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ import {
1616
import { usePendingPermissionsForTask } from "@features/sessions/stores/sessionStore";
1717
import { useCwd } from "@features/sidebar/hooks/useCwd";
1818
import { useCloudRunState } from "@features/task-detail/hooks/useCloudRunState";
19-
import { useFocusWorkspace } from "@features/workspace/hooks/useFocusWorkspace";
2019
import {
2120
ArrowCounterClockwiseIcon,
22-
ArrowsClockwise,
2321
CaretDownIcon,
2422
CaretUpIcon,
2523
CodeIcon,
@@ -624,8 +622,6 @@ export function ChangesPanel({ taskId, task }: ChangesPanelProps) {
624622

625623
function LocalChangesPanel({ taskId, task: _task }: ChangesPanelProps) {
626624
const workspace = useWorkspace(taskId);
627-
const { isFocused, isFocusLoading, handleToggleFocus, handleUnfocus } =
628-
useFocusWorkspace(taskId);
629625
const repoPath = useCwd(taskId);
630626
const layout = usePanelLayoutStore((state) => state.getLayout(taskId));
631627
const openDiffByMode = usePanelLayoutStore((state) => state.openDiffByMode);
@@ -683,73 +679,6 @@ function LocalChangesPanel({ taskId, task: _task }: ChangesPanelProps) {
683679
return isDiffTabActiveInTree(layout.panelTree, file.path, file.status);
684680
};
685681

686-
const showFocusCta = workspace?.mode === "worktree";
687-
const focusCta = showFocusCta ? (
688-
<Box px="2" pb="2">
689-
<Flex
690-
align="center"
691-
justify="between"
692-
gap="2"
693-
px="3"
694-
py="2"
695-
style={{
696-
borderRadius: "999px",
697-
border: "1px solid var(--gray-4)",
698-
backgroundColor: "var(--gray-2)",
699-
}}
700-
>
701-
<Flex align="center" gap="2">
702-
{isFocused ? (
703-
<Box
704-
style={{
705-
width: "8px",
706-
height: "8px",
707-
borderRadius: "999px",
708-
backgroundColor: "var(--green-9)",
709-
}}
710-
/>
711-
) : (
712-
<ArrowsClockwise size={14} weight="bold" />
713-
)}
714-
<Text size="1" style={{ color: "var(--gray-11)" }}>
715-
{isFocused ? "Workspace synced" : "Focus workspace"}
716-
</Text>
717-
</Flex>
718-
{isFocused ? (
719-
<Button
720-
size="1"
721-
variant="ghost"
722-
color="gray"
723-
onClick={handleUnfocus}
724-
disabled={isFocusLoading}
725-
style={{
726-
textDecoration: "underline",
727-
textUnderlineOffset: "2px",
728-
color: "var(--gray-11)",
729-
}}
730-
>
731-
{isFocusLoading ? <Spinner size="1" /> : "Cancel"}
732-
</Button>
733-
) : (
734-
<Button
735-
size="1"
736-
variant="ghost"
737-
color="gray"
738-
onClick={handleToggleFocus}
739-
disabled={isFocusLoading}
740-
style={{
741-
textDecoration: "underline",
742-
textUnderlineOffset: "2px",
743-
color: "var(--gray-11)",
744-
}}
745-
>
746-
{isFocusLoading ? <Spinner size="1" /> : "Focus"}
747-
</Button>
748-
)}
749-
</Flex>
750-
</Box>
751-
) : null;
752-
753682
if (!repoPath) {
754683
return <PanelMessage>No repository path available</PanelMessage>;
755684
}
@@ -764,10 +693,7 @@ function LocalChangesPanel({ taskId, task: _task }: ChangesPanelProps) {
764693
return (
765694
<Box height="100%" overflowY="auto" py="2">
766695
<Flex direction="column" height="100%">
767-
{focusCta}
768-
<Box flexGrow="1">
769-
<PanelMessage>No file changes yet</PanelMessage>
770-
</Box>
696+
<PanelMessage>No file changes yet</PanelMessage>
771697
</Flex>
772698
</Box>
773699
);
@@ -776,7 +702,6 @@ function LocalChangesPanel({ taskId, task: _task }: ChangesPanelProps) {
776702
return (
777703
<Box height="100%" overflowY="auto" py="2">
778704
<Flex direction="column">
779-
{focusCta}
780705
{changedFiles.map((file) => (
781706
<ChangedFileItem
782707
key={file.path}

0 commit comments

Comments
 (0)