Skip to content

Commit f5ff75e

Browse files
Explore merging sim and device serial terminals
1 parent 925f3b2 commit f5ff75e

10 files changed

Lines changed: 758 additions & 106 deletions

File tree

src/messages/ui.en.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,24 @@
16971697
"value": "micro:bit ready to flash"
16981698
}
16991699
],
1700+
"serial-error": [
1701+
{
1702+
"type": 0,
1703+
"value": "error"
1704+
}
1705+
],
1706+
"serial-source-device": [
1707+
{
1708+
"type": 0,
1709+
"value": "micro:bit"
1710+
}
1711+
],
1712+
"serial-source-simulator": [
1713+
{
1714+
"type": 0,
1715+
"value": "Simulator"
1716+
}
1717+
],
17001718
"serial-running": [
17011719
{
17021720
"type": 0,

src/serial/SerialArea.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ interface SerialAreaProps extends BoxProps {
2020
hideExpandTextOnTraceback?: boolean;
2121
showHintsAndTips?: boolean;
2222
tabOutRef: HTMLElement;
23+
/**
24+
* Whether this area is the visible one (shared device/simulator panel).
25+
* When it becomes visible again its terminal is re-fitted so content shows
26+
* without needing a scroll. Defaults to true for standalone use.
27+
*/
28+
active?: boolean;
2329
}
2430

2531
/**
@@ -39,6 +45,7 @@ const SerialArea = ({
3945
hideExpandTextOnTraceback = false,
4046
showHintsAndTips = true,
4147
tabOutRef,
48+
active = true,
4249
...props
4350
}: SerialAreaProps) => {
4451
const status = useConnectionStatus();
@@ -76,6 +83,7 @@ const SerialArea = ({
7683
mr={1}
7784
fontSizePt={terminalFontSizePt}
7885
tabOutRef={tabOutRef}
86+
active={active}
7987
/>
8088
</Box>
8189
)}

0 commit comments

Comments
 (0)