diff --git a/editor/src/components/canvas/controls/select-mode/remix-scene-label.tsx b/editor/src/components/canvas/controls/select-mode/remix-scene-label.tsx index 34408a70c7da..55cd61e09e81 100644 --- a/editor/src/components/canvas/controls/select-mode/remix-scene-label.tsx +++ b/editor/src/components/canvas/controls/select-mode/remix-scene-label.tsx @@ -22,6 +22,9 @@ import { unless } from '../../../../utils/react-conditionals' export const RemixSceneLabelPathTestId = (path: ElementPath): string => `${EP.toString(path)}-remix-scene-label-path` +export const RemixSceneLabelTestId = (path: ElementPath): string => + `${EP.toString(path)}-remix-scene-label-test-id` + export const LocationDoesNotMatchRoutesTestId = 'location-does-not-match-routes' export const RemixSceneHomeLabel = '(home)' @@ -94,7 +97,19 @@ const RemixSceneLabel = React.memo((props) => { const currentPath = (navigationData[EP.toString(props.target)] ?? null)?.location.pathname const isIndexRoute = currentPath === '/' - const label = isIndexRoute ? RemixSceneHomeLabel : currentPath + const pathLabel = isIndexRoute ? RemixSceneHomeLabel : currentPath + + const scenelabel = useEditorState( + Substores.metadata, + (store) => + MetadataUtils.getElementLabel( + store.editor.allElementProps, + props.target, + store.editor.elementPathTree, + store.editor.jsxMetadata, + ), + 'SceneLabel label', + ) const currentLocationMatchesRoutes = useCurrentLocationMatchesRoutes(props.target) @@ -133,12 +148,13 @@ const RemixSceneLabel = React.memo((props) => { (store) => store.editor.canvas.scale, 'RemixSceneLabel scale', ) - const baseFontSize = 9 + const baseFontSize = 10 const scaledFontSize = baseFontSize / scale const scaledLineHeight = 17 / scale - const paddingY = scaledFontSize / 2 - const offsetY = scaledFontSize - const offsetX = scaledFontSize + const paddingY = scaledFontSize / 4 + const paddingX = paddingY * 2 + const offsetY = scaledFontSize / 1.5 + const offsetX = scaledFontSize / 2 const borderRadius = 3 / scale const editorModeRef = useRefEditorState((store) => { @@ -243,14 +259,12 @@ const RemixSceneLabel = React.memo((props) => { className='roleComponentName' style={{ pointerEvents: labelSelectable ? 'initial' : 'none', - color: isIndexRoute ? colorTheme.aqua.value : colorTheme.textColor.value, + color: colorTheme.aqua.value, position: 'absolute', left: frame.x, bottom: -frame.y + offsetY, width: frame.width, - paddingLeft: offsetX, - paddingTop: paddingY, - paddingBottom: paddingY, + padding: `${paddingY}px ${paddingX}px`, fontFamily: 'Utopian-Inter', fontSize: scaledFontSize, lineHeight: `${scaledLineHeight}px`, @@ -259,47 +273,72 @@ const RemixSceneLabel = React.memo((props) => { textOverflow: 'ellipsis', borderRadius: borderRadius, backgroundColor: backgroundColor, - gap: 12 / scale, + justifyContent: 'space-between', }} > - - +
- 〱 - - - - +
- 〱 - - - - - / - - -
- {label} -
+ {pathLabel} +
+ + + + + 〱 + + + + + 〱 + + + + + ⛫ + + + + {unless( currentLocationMatchesRoutes, diff --git a/editor/src/components/canvas/controls/select-mode/scene-label.tsx b/editor/src/components/canvas/controls/select-mode/scene-label.tsx index 6b3d8d42c3f3..9d71641312b3 100644 --- a/editor/src/components/canvas/controls/select-mode/scene-label.tsx +++ b/editor/src/components/canvas/controls/select-mode/scene-label.tsx @@ -5,7 +5,7 @@ import { isFiniteRectangle, windowPoint } from '../../../../core/shared/math-uti import type { ElementPath } from '../../../../core/shared/project-file-types' import { NO_OP } from '../../../../core/shared/utils' import { Modifier } from '../../../../utils/modifiers' -import { useColorTheme } from '../../../../uuiui' +import { FlexRow, useColorTheme } from '../../../../uuiui' import { clearHighlightedViews, selectComponents } from '../../../editor/actions/action-creators' import { useDispatch } from '../../../editor/store/dispatch-context' import { Substores, useEditorState, useRefEditorState } from '../../../editor/store/store-hook' @@ -99,11 +99,12 @@ const SceneLabel = React.memo((props) => { (store) => store.editor.canvas.scale, 'SceneLabel scale', ) - const baseFontSize = 9 + const baseFontSize = 10 const scaledFontSize = baseFontSize / scale const scaledLineHeight = 17 / scale - const paddingY = scaledFontSize / 9 - const offsetY = scaledFontSize / 3 + const paddingY = scaledFontSize / 4 + const paddingX = paddingY * 2 + const offsetY = scaledFontSize / 1.5 const offsetX = scaledFontSize / 2 const borderRadius = 3 / scale @@ -194,13 +195,13 @@ const SceneLabel = React.memo((props) => { const selectedBackgroundColor = sceneHasSingleChild ? colorTheme.componentPurple05solid.value - : colorTheme.bg5.value + : colorTheme.bg510solid.value const backgroundColor = isSelected ? selectedBackgroundColor : 'transparent' if (frame != null && isFiniteRectangle(frame)) { return ( -
((props) => { className='roleComponentName' style={{ pointerEvents: labelSelectable ? 'initial' : 'none', - color: sceneHasSingleChild - ? colorTheme.componentPurple.value - : colorTheme.subduedForeground.value, + color: sceneHasSingleChild ? colorTheme.componentPurple.value : colorTheme.fg2.value, position: 'absolute', fontWeight: 600, left: frame.x, bottom: -frame.y + offsetY, width: frame.width, - paddingLeft: offsetX, - paddingBottom: paddingY, + padding: `${paddingY}px ${paddingX}px`, fontFamily: 'Utopian-Inter', fontSize: scaledFontSize, lineHeight: `${scaledLineHeight}px`, @@ -229,8 +227,14 @@ const SceneLabel = React.memo((props) => { backgroundColor: backgroundColor, }} > - {label} -
+
+ {label} +
+
) } else { diff --git a/editor/src/components/editor/canvas-toolbar.tsx b/editor/src/components/editor/canvas-toolbar.tsx index 20a032056426..d538263d8a6b 100644 --- a/editor/src/components/editor/canvas-toolbar.tsx +++ b/editor/src/components/editor/canvas-toolbar.tsx @@ -747,7 +747,7 @@ export const CanvasToolbar = React.memo(() => { height: 32, overflow: 'hidden', backgroundColor: colorTheme.bg2.value, - borderRadius: '0px 10px 10px 10px', + borderRadius: '0px 0px 10px 10px', boxShadow: UtopiaTheme.panelStyles.shadows.medium, pointerEvents: 'initial', zIndex: -1, // it sits below the main menu row, but we want the main menu's shadow to cast over this one diff --git a/editor/src/components/editor/remix-navigation-bar.tsx b/editor/src/components/editor/remix-navigation-bar.tsx index 134e33a02c19..15da34a77e27 100644 --- a/editor/src/components/editor/remix-navigation-bar.tsx +++ b/editor/src/components/editor/remix-navigation-bar.tsx @@ -1,3 +1,6 @@ +/** @jsxRuntime classic */ +/** @jsx jsx */ +import { jsx } from '@emotion/react' import { useAtom } from 'jotai' import React from 'react' import { @@ -5,7 +8,7 @@ import { RemixNavigationAtom, } from '../canvas/remix/utopia-remix-root-component' import { Substores, useEditorState } from './store/store-hook' -import { FlexRow, Tooltip, UtopiaTheme, useColorTheme } from '../../uuiui' +import { FlexRow, Tooltip, UtopiaTheme, colorTheme, useColorTheme } from '../../uuiui' import { stopPropagation } from '../inspector/common/inspector-utils' import * as EP from '../../core/shared/element-path' @@ -54,53 +57,65 @@ export const RemixNavigationBar = React.memo(() => { return ( - + - + - + - / + ⛫
{label} diff --git a/editor/src/uuiui/styles/theme/dark.ts b/editor/src/uuiui/styles/theme/dark.ts index 5bfb333bb830..f1704a162b78 100644 --- a/editor/src/uuiui/styles/theme/dark.ts +++ b/editor/src/uuiui/styles/theme/dark.ts @@ -26,14 +26,15 @@ const darkBase = { componentOrange: createUtopiColor('oklch(80.6% 0.15 50)'), componentPurple: createUtopiColor('oklch(76% 0.155 300)'), componentPurple05: createUtopiColor('oklch(76% 0.155 300 / 5%)'), - componentPurple05solid: createUtopiColor('oklch(5% 0.155 300)'), + componentPurple05solid: createUtopiColor('oklch(0.4 0.04 284.66)'), dynamicBlue: createUtopiColor('oklch(81% 0.11 241)'), dynamicBlue10: createUtopiColor('oklch(81% 0.11 241 / 10%)'), unavailable: createUtopiColor('oklch(0% 0 0 / 5%)'), unavailableGrey: createUtopiColor('oklch(100% 0 0 / 22%)'), unavailableGrey10: createUtopiColor('oklch(100% 0 0 / 10%)'), aqua: createUtopiColor('oklch(86% 0.135 208.71)'), - aqua05solid: createUtopiColor('oklch(5% 0.135 208.71)'), + aqua05solid: createUtopiColor('oklch(0.41 0.03 238.48)'), + bg510solid: createUtopiColor('oklch(0.41 0.02 269.74)'), bg0: createUtopiColor('#000000'), bg1: createUtopiColor('#181C20'), bg2: createUtopiColor('#20232C'), diff --git a/editor/src/uuiui/styles/theme/light.ts b/editor/src/uuiui/styles/theme/light.ts index 3d38d25c1e25..7a32ac46cf88 100644 --- a/editor/src/uuiui/styles/theme/light.ts +++ b/editor/src/uuiui/styles/theme/light.ts @@ -27,14 +27,15 @@ const lightBase = { componentOrange: createUtopiColor('oklch(68% 0.2 42)'), componentPurple: createUtopiColor('oklch(53% 0.31 290)'), componentPurple05: createUtopiColor('oklch(53.19% 0.307 289.7 / 5%)'), - componentPurple05solid: createUtopiColor('oklch(0.96 0.02 286)'), + componentPurple05solid: createUtopiColor('oklch(0.96 0.02 287)'), dynamicBlue: createUtopiColor('oklch(59% 0.25 254)'), dynamicBlue10: createUtopiColor('oklch(58.98% 0.246 254.39 / 10%)'), unavailable: createUtopiColor('oklch(54.52% 0 0 / 5%)'), unavailableGrey: createUtopiColor('oklch(0% 0 0 / 22%)'), unavailableGrey10: createUtopiColor('oklch(0% 0 0 / 10%)'), aqua: createUtopiColor('oklch(0.74 0.18 218.28)'), - aqua05solid: createUtopiColor('oklch(0.98 0.02 211)'), + aqua05solid: createUtopiColor('oklch(0.95 0.02 208.7)'), + bg510solid: createUtopiColor('oklch(0.95 0 0)'), bg0: createUtopiColor('hsl(0,0%,100%)'), bg1: createUtopiColor('lch(99.5 0.01 0)'), bg2: createUtopiColor('lch(98.0 0.01 0)'),