فهرست منبع

Merge pull request #34479 from overleaf/mj-toolbar-border

[web] Hide toolbar border when tabs are enabled

GitOrigin-RevId: 58a33980006d1bc148db16d864fc0547d9c5d421
Mathias Jakobsen 1 ماه پیش
والد
کامیت
481a0b1da9

+ 5 - 0
services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx

@@ -181,6 +181,11 @@ const Toolbar = memo(function Toolbar() {
         id="ol-cm-toolbar-wrapper"
         className={classNames('ol-cm-toolbar-wrapper', {
           'ol-cm-toolbar-wrapper-indented': showReviewPanelHeader,
+          // The border is only needed when the header is flush with the
+          // toolbar, which is the case when tabs are disabled and the review
+          // panel is shown
+          'ol-cm-toolbar-wrapper-needs-border':
+            showReviewPanelHeader && !tabsVisible,
         })}
       >
         <div

+ 4 - 3
services/web/frontend/js/features/source-editor/extensions/toolbar/toolbar-panel.ts

@@ -152,9 +152,10 @@ const toolbarTheme = EditorView.theme({
       padding: 0,
     },
   },
-  '.ol-cm-toolbar-wrapper-indented .ol-cm-toolbar-button-group:first-child': {
-    borderLeft: '1px solid rgba(125, 125, 125, 0.3)',
-  },
+  '.ol-cm-toolbar-wrapper-needs-border .ol-cm-toolbar-button-group:first-child':
+    {
+      borderLeft: '1px solid rgba(125, 125, 125, 0.3)',
+    },
   '.ol-cm-toolbar-button': {
     display: 'inline-flex',
     alignItems: 'center',