From 7c13469ee555340e60654d0b008e54687fa32afa Mon Sep 17 00:00:00 2001 From: Jo Humphrey <31373245+jamdelion@users.noreply.github.com> Date: Wed, 9 Sep 2026 15:57:23 +0100 Subject: [PATCH 1/2] Experiment to add additional project instructions collapse button --- public/translations/en-US.json | 4 +- public/translations/en.json | 2 + src/assets/stylesheets/Project.scss | 26 ++++++ src/assets/stylesheets/Sidebar.scss | 32 +++++++ src/components/Editor/Project/Project.jsx | 21 +++-- .../InstructionsPanel/InstructionsPanel.jsx | 31 ++++++- .../InstructionsPanel.test.jsx | 38 +++++++++ src/components/Menus/Sidebar/Sidebar.jsx | 5 +- src/components/Menus/Sidebar/SidebarBar.jsx | 12 +-- .../Menus/Sidebar/SidebarExpandButton.jsx | 64 ++++++++++++++ .../Sidebar/SidebarExpandButton.test.jsx | 83 +++++++++++++++++++ src/components/Menus/Sidebar/SidebarPanel.jsx | 7 +- 12 files changed, 309 insertions(+), 16 deletions(-) create mode 100644 src/components/Menus/Sidebar/SidebarExpandButton.jsx create mode 100644 src/components/Menus/Sidebar/SidebarExpandButton.test.jsx diff --git a/public/translations/en-US.json b/public/translations/en-US.json index a73e8f6b1..62c0ef274 100644 --- a/public/translations/en-US.json +++ b/public/translations/en-US.json @@ -308,8 +308,10 @@ }, "sidebar": { "collapse": "Collapse sidebar", + "collapseInstructions": "Collapse project instructions", "download": "Download project", "expand": "Expand sidebar", + "expandInstructions": "Open project instructions", "file": "Project files", "images": "Image gallery", "settings": "Settings", @@ -355,4 +357,4 @@ "common": { "or": "or" } -} \ No newline at end of file +} diff --git a/public/translations/en.json b/public/translations/en.json index 0ecc5f9e4..178693e70 100644 --- a/public/translations/en.json +++ b/public/translations/en.json @@ -308,8 +308,10 @@ }, "sidebar": { "collapse": "Collapse sidebar", + "collapseInstructions": "Collapse project instructions", "download": "Download project", "expand": "Expand sidebar", + "expandInstructions": "Open project instructions", "file": "Project files", "images": "Image gallery", "settings": "Settings", diff --git a/src/assets/stylesheets/Project.scss b/src/assets/stylesheets/Project.scss index d9fe8c518..3323ef8f3 100644 --- a/src/assets/stylesheets/Project.scss +++ b/src/assets/stylesheets/Project.scss @@ -50,6 +50,32 @@ overflow: hidden; } + .project-bar-row { + display: flex; + align-items: stretch; + gap: var(--project-wrapper-grid-gap, #{$space-0-5}); + + .project-bar { + flex: 1 1 auto; + min-inline-size: 0; + } + } + + .project-bar-row__expand { + display: flex; + align-items: center; + flex-shrink: 0; + box-sizing: border-box; + padding: $space-0-5; + border-radius: $space-0-5; + background-color: var(--editor-color-layer-3); + border: 1px solid var(--editor-color-outline); + + .rpf-button { + border: none; + } + } + .proj-editor-wrapper { display: flex; flex: 0 1 auto; diff --git a/src/assets/stylesheets/Sidebar.scss b/src/assets/stylesheets/Sidebar.scss index 916669c3a..14ec3dea3 100644 --- a/src/assets/stylesheets/Sidebar.scss +++ b/src/assets/stylesheets/Sidebar.scss @@ -122,9 +122,41 @@ .sidebar__panel-heading { margin: 0; + min-inline-size: 0; @include font-size-1-5(regular); } +.sidebar__panel-heading-row { + display: flex; + align-items: center; + gap: var(--space-0-5); + + .rpf-button { + border: none; + } +} + +.sidebar__panel-collapse { + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + flex-shrink: 0; + margin: 0; + border: 1px solid var(--sidebar-border); + border-radius: var(--space-1); + padding: var(--space-1); + color: var(--editor-color-text); + + svg { + margin: 0; + } + + &:hover { + background-color: var(--sidebar-option-hover); + } +} + .sidebar__panel-header { display: flex; flex-direction: column; diff --git a/src/components/Editor/Project/Project.jsx b/src/components/Editor/Project/Project.jsx index a99fe0c36..bbb61fd5f 100644 --- a/src/components/Editor/Project/Project.jsx +++ b/src/components/Editor/Project/Project.jsx @@ -10,6 +10,7 @@ import { showSavedMessage } from "../../../utils/Notifications"; import ProjectBar from "../../ProjectBar/ProjectBar"; import ScratchProjectBar from "../../ProjectBar/ScratchProjectBar"; import Sidebar from "../../Menus/Sidebar/Sidebar"; +import SidebarExpandButton from "../../Menus/Sidebar/SidebarExpandButton"; import EditorInput from "../EditorInput/EditorInput"; import ResizableWithHandle from "../../../utils/ResizableWithHandle"; import { useContainerMinWidth } from "../../../hooks/useContainerMinWidth"; @@ -69,12 +70,20 @@ const Project = (props) => { /> )}