Skip to content

Commit b9481df

Browse files
authored
fix: change tab block-size to min-block-size to allow height to grow (#1219)
Closes: RaspberryPiFoundation/digital-editor-issues#690 ## Summary **Issue related:** - Change tab `block-size` to `min-block-size` to allow height to grow - Also change to correct custom property to ensure minimum target size **Fixing failing tests:** - The Skulpt runner implementation was hiding tab/elements by setting block-size (height) to 0. As a result when using `min-block-size` this was causing cypress visiblity test to fail. - It was previously passing since cypress considers height 0 as not visible. - This implementation has now been changed to set `display: none` to properly remove the element - There are 2 other potential changes that could be made here 1. Conditially render the elements instead - as the [PyodideRunner](https://github.com/RaspberryPiFoundation/editor-ui/blob/main/src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx#L440) does 2. Change the cypress test to check for [existence](https://docs.cypress.io/api/commands/its#Existence) instead - I've opted not to change the above to keep this PR smaller ## Demo ![Screenshot 2025-06-17 at 16 32 17](https://github.com/user-attachments/assets/0686064b-c3d5-4a70-b1b6-86e670754dc0)
1 parent e869bc1 commit b9481df

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## Unreleased
88

9+
## Fixed
10+
11+
- Styling issue preventing scrolling in the sidebar (#1216)
12+
- Styling issue on status bar on mobile (#1217)
13+
- Change tab `block-size` to `min-block-size` to allow for height increase when text wraps (#1219)
14+
- Changed `SkulptRunner.jsx` implementation of hiding elements to use `display: none` rather than `block-size: 0` (#1219)
15+
916
## [0.30.1] - 2025-06-09
1017

1118
### Added
@@ -19,8 +26,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1926
### Fixed
2027

2128
- Styling issue on sidebar on mobile (#1194)
22-
- Styling issue preventing scrolling in the sidebar (#1216)
23-
- Styling issue on status bar on mobile (#1217)
2429

2530
## [0.30.0] - 2025-04-15
2631

src/assets/stylesheets/Tabs.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
margin: 0;
2020
inset-block-start: 0;
2121
inset-block-end: 0;
22-
block-size: $space-3;
22+
min-block-size: var(--min-target-size);
2323
box-sizing: border-box;
2424
display: flex;
2525
align-items: center;

src/components/Editor/Runners/PythonRunner/SkulptRunner/SkulptRunner.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ const SkulptRunner = ({ active, outputPanels = ["text", "visual"] }) => {
485485
{showVisualOutputPanel && (
486486
<div
487487
className={outputPanelClasses("visual")}
488-
style={{ blockSize: showVisualOutput ? "auto" : 0 }}
488+
style={{ display: showVisualOutput ? undefined : "none" }}
489489
>
490490
<Tabs forceRenderTabPanel={true}>
491491
<div
@@ -549,7 +549,10 @@ const SkulptRunner = ({ active, outputPanels = ["text", "visual"] }) => {
549549
>
550550
<div className="react-tabs__tab-container">
551551
<TabList>
552-
<Tab key={0} style={{ blockSize: showVisualOutput ? "auto" : 0 }}>
552+
<Tab
553+
key={0}
554+
style={{ display: showVisualOutput ? undefined : "none" }}
555+
>
553556
<span className="react-tabs__tab-text">
554557
{t("output.visualOutput")}
555558
</span>

0 commit comments

Comments
 (0)