Skip to content

Commit 88e7585

Browse files
Minor tweaks
1 parent f5ff75e commit 88e7585

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

src/serial/SerialPanel.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ const SerialPanel = ({
219219
const showDeviceSync =
220220
active === "device" &&
221221
(!activeTraceback || deviceSync === SyncStatus.OUT_OF_SYNC);
222+
// The traceback only belongs in the header when collapsed; when expanded
223+
// it's already visible in the terminal itself.
224+
const showTraceback = Boolean(compact && activeTraceback);
222225
// The status colour for a source: red for an (up-to-date) runtime error, a
223226
// darker shade when there's code to flash/run, otherwise the terminal
224227
// background. Applied per source so a healthy tab stays neutral even if the
@@ -282,14 +285,6 @@ const SerialPanel = ({
282285
<HStack spacing={2}>
283286
<Icon as={icon} color={accent} boxSize={4} />
284287
<Text>{intl.formatMessage({ id: labelId })}</Text>
285-
{states[source]?.traceback && (
286-
<Icon
287-
as={RiErrorWarningLine}
288-
color="red.300"
289-
boxSize={4}
290-
aria-label={intl.formatMessage({ id: "serial-error" })}
291-
/>
292-
)}
293288
</HStack>
294289
</Tab>
295290
);
@@ -321,7 +316,7 @@ const SerialPanel = ({
321316
boxSize={5}
322317
/>
323318
</Text>
324-
) : activeTraceback ? (
319+
) : showTraceback ? (
325320
<HStack spacing={1} pr={1} maxW="20rem" overflow="hidden">
326321
<Icon
327322
as={RiErrorWarningLine}
@@ -341,16 +336,16 @@ const SerialPanel = ({
341336
</Box>
342337
</HStack>
343338
) : null}
344-
{(showDeviceSync || activeTraceback) && (
339+
{(showDeviceSync || showTraceback) && (
345340
<Divider
346341
orientation="vertical"
347342
height={6}
348-
mx={1}
343+
mx={2}
349344
borderColor="whiteAlpha.400"
350345
/>
351346
)}
352347
<CollapsibleButton
353-
mode={activeTraceback ? "icon" : "button"}
348+
mode={showTraceback ? "icon" : "button"}
354349
variant="unstyled"
355350
display="flex"
356351
fontWeight="normal"

0 commit comments

Comments
 (0)