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
Expand Up @@ -22,6 +22,7 @@
flex: 1 1 35%;
overflow-x: hidden;
overflow-y: auto;
border-left: 1px solid var(--color-border);
}

.ResizeBarWrapper {
Expand Down Expand Up @@ -55,6 +56,7 @@

.InspectedElementWrapper {
flex: 1 1 50%;
border-left: none;
}

.ResizeBar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ function Components(_: {}) {
<div className={styles.InspectedElementWrapper}>
<NativeStyleContextController>
<InspectedElementErrorBoundary>
<InspectedElement />
<InspectedElement
fallbackEmpty={
'No React element selected. Select an element in the tree to inspect.'
}
/>
</InspectedElementErrorBoundary>
</NativeStyleContextController>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
flex-direction: column;
height: 100%;
width: 100%;
border-left: 1px solid var(--color-border);
border-top: 1px solid var(--color-border);
}

Expand Down Expand Up @@ -69,7 +68,11 @@
padding: 0.25rem;
color: var(--color-dimmer);
font-style: italic;
border-left: 1px solid var(--color-border);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placing the border here made the border only span a single line. Now the border is one the whole container while also not being duplicated if the parent already defines a border. This makes composition easier with regards to border drawing.

}

.NoInspectionFallback {
padding: 0.25rem;
font-style: italic;
}

.StrictModeNonCompliant {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import Tooltip from './reach-ui/tooltip';

export type Props = {
actionButtons?: React.Node,
/** fallback to show when no element is inspected */
fallbackEmpty: React.Node,
};

// TODO Make edits and deletes also use transition API!
Expand All @@ -44,6 +46,7 @@ const noSourcePromise = Promise.resolve(null);

export default function InspectedElementWrapper({
actionButtons,
fallbackEmpty,
}: Props): React.Node {
const {inspectedElementID} = useContext(TreeStateContext);
const bridge = useContext(BridgeContext);
Expand Down Expand Up @@ -193,6 +196,7 @@ export default function InspectedElementWrapper({
return (
<div className={styles.InspectedElement}>
<div className={styles.TitleRow} />
<div className={styles.NoInspectionFallback}>{fallbackEmpty}</div>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also show the loading fallback below the title row.

</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function InspectedElementPane() {
<div className={styles.InspectedElementPane}>
<InspectedElement
actionButtons={!hideSettings && <SettingsModalContextToggle />}
fallbackEmpty={"Selected element wasn't rendered with React."}
/>
<SettingsModal />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
flex: 0 0 calc(100% - var(--horizontal-resize-tree-percentage));
overflow-x: hidden;
overflow-y: auto;
border-left: 1px solid var(--color-border);
}

.ResizeBarWrapper {
Expand Down Expand Up @@ -70,6 +71,7 @@

.InspectedElementWrapper {
flex: 0 0 calc(100% - var(--vertical-resize-tree-percentage));
border-left: none;
}

.TreeWrapper + .ResizeBarWrapper .ResizeBar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,11 @@ function SuspenseTab(_: {}) {
className={styles.InspectedElementWrapper}
hidden={inspectedElementHidden}>
<InspectedElementErrorBoundary>
<InspectedElement />
<InspectedElement
fallbackEmpty={
'No React element selected. Select a Suspense boundary in the minimap to inspect.'
}
/>
</InspectedElementErrorBoundary>
</div>
<SettingsModal />
Expand Down
Loading