This repository was archived by the owner on Aug 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Clarify diff view controls #3906
Merged
+86
−24
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f8b324d
Clarify diff view controls
dmarticus 84101b3
Allow closing empty cloud panels
dmarticus 9cfa842
Prevent unusable panel splits
dmarticus 0bab7a0
Keep panel splitting available for local runs
dmarticus 5f052dc
Format panel close control
dmarticus aeef48a
Disable cloud panel drag splitting
dmarticus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,12 @@ | ||
| import { Cloud as CloudIcon } from "@phosphor-icons/react"; | ||
| import { | ||
| Empty, | ||
| EmptyDescription, | ||
| EmptyHeader, | ||
| EmptyMedia, | ||
| EmptyTitle, | ||
| } from "@posthog/quill"; | ||
| import type { Task } from "@posthog/shared/domain-types"; | ||
| import { Flex, Text } from "@radix-ui/themes"; | ||
| import type React from "react"; | ||
| import { useMemo } from "react"; | ||
| import { useHostCapabilities } from "../../../shell/useHostCapabilities"; | ||
|
|
@@ -56,23 +62,29 @@ export const LeafNodeRenderer: React.FC<LeafNodeRendererProps> = ({ | |
| const activeTabId = tabs.some((t) => t.id === node.content.activeTabId) | ||
| ? node.content.activeTabId | ||
| : (tabs[0]?.id ?? node.content.activeTabId); | ||
| const hiddenTabIds = useMemo(() => { | ||
| const visibleTabIds = new Set(tabs.map((tab) => tab.id)); | ||
| const hiddenIds: string[] = []; | ||
| for (const tab of node.content.tabs) { | ||
| if (!visibleTabIds.has(tab.id)) hiddenIds.push(tab.id); | ||
| } | ||
| return hiddenIds; | ||
| }, [node.content.tabs, tabs]); | ||
|
|
||
| const cloudEmptyState = useMemo( | ||
| () => | ||
| isCloud ? ( | ||
| <Flex | ||
| align="center" | ||
| justify="center" | ||
| height="100%" | ||
| className="bg-(--gray-2)" | ||
| > | ||
| <Flex direction="column" align="center" gap="2"> | ||
| <CloudIcon size={24} className="text-gray-10" /> | ||
| <Text color="gray" className="text-sm"> | ||
| Cloud runs are read-only | ||
| </Text> | ||
| </Flex> | ||
| </Flex> | ||
| <Empty className="h-full border-0 bg-(--gray-2)"> | ||
| <EmptyHeader> | ||
| <EmptyMedia variant="icon"> | ||
| <CloudIcon size={24} className="text-gray-10" /> | ||
| </EmptyMedia> | ||
| <EmptyTitle>Cloud runs are read-only</EmptyTitle> | ||
| <EmptyDescription> | ||
| Local workspace tools are unavailable for this run. | ||
| </EmptyDescription> | ||
| </EmptyHeader> | ||
| </Empty> | ||
| ) : undefined, | ||
| [isCloud], | ||
| ); | ||
|
|
@@ -95,8 +107,20 @@ export const LeafNodeRenderer: React.FC<LeafNodeRendererProps> = ({ | |
| onPanelFocus={onPanelFocus} | ||
| draggingTabId={draggingTabId} | ||
| draggingTabPanelId={draggingTabPanelId} | ||
| allowPanelSplit={!isCloud} | ||
| onAddTerminal={hideTerminal ? undefined : () => onAddTerminal(node.id)} | ||
| onSplitPanel={(direction) => onSplitPanel(node.id, direction)} | ||
| onSplitPanel={ | ||
| isCloud ? undefined : (direction) => onSplitPanel(node.id, direction) | ||
| } | ||
|
Comment on lines
+112
to
+114
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a tab is dragged onto an edge drop zone in a cloud layout, Rule Used: When implementing new features, ensure that the UI... (source) Learned From Prompt To Fix With AIThis is a comment left during a code review.
Path: packages/ui/src/features/panels/components/LeafNodeRenderer.tsx
Line: 110-112
Comment:
**Cloud drag splitting remains enabled**
When a tab is dragged onto an edge drop zone in a cloud layout, `PanelDropZones` invokes the store's split operation independently of `onSplitPanel`, causing an unsupported split pane—including an empty pane when its terminal tab is filtered—to be created and persisted despite this cloud guard.
**Rule Used:** When implementing new features, ensure that the UI... ([source](https://app.greptile.com/posthog-org-19734/-/custom-context?memory=5d57f0af-0be1-44de-8885-055f27e2885f))
**Learned From**
[PostHog/posthog#32595](https://github.com/PostHog/posthog/pull/32595)
[PostHog/posthog#32677](https://github.com/PostHog/posthog/pull/32677)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly. |
||
| onClosePanel={ | ||
| tabs.length === 0 && hiddenTabIds.length > 0 | ||
| ? () => { | ||
| for (const tabId of hiddenTabIds) { | ||
| closeTab(taskId, node.id, tabId); | ||
| } | ||
| } | ||
| : undefined | ||
| } | ||
| emptyState={cloudEmptyState} | ||
| /> | ||
| ); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Non-blocking: I wonder if we should change the icon to reflect that it's just a diff wheel view and not a split