Skip to content

Build your personal knowledge base with Trilium Notes

fix(client): inconsistent first tab spacing

Steven Xu1be158b6402c
diff --git a/apps/client/src/stylesheets/theme-next/base.css b/apps/client/src/stylesheets/theme-next/base.css
index f9ae44abca..0178c76df7 100644
--- a/apps/client/src/stylesheets/theme-next/base.css
+++ b/apps/client/src/stylesheets/theme-next/base.css
@@ -56,7 +56,6 @@
--tab-bar-height: 50px;
--tab-height: 36px;
- --tab-first-item-horiz-offset: 0;
--new-tab-button-size: 24px;
--center-pane-border-radius: 10px;
diff --git a/apps/client/src/stylesheets/theme-next/shell.css b/apps/client/src/stylesheets/theme-next/shell.css
index 69b345bc86..6c7404c83d 100644
--- a/apps/client/src/stylesheets/theme-next/shell.css
+++ b/apps/client/src/stylesheets/theme-next/shell.css
@@ -111,7 +111,6 @@ body.background-effects.theme-supports-background-effects #center-pane .note-spl
/* Matches when the left pane is collapsed */
#horizontal-main-container.left-pane-hidden {
--note-split-top-border-radius: 0;
- --tab-first-item-horiz-offset: 5px;
}
/* Matches when a status bar panel is open */
@@ -1182,10 +1181,6 @@ body.layout-horizontal div.tab-row-widget div.note-tab div.note-tab-wrapper {
background-color: var(--workspace-tab-background-color);
}
-body:not([dir=rtl]) .tab-row-widget .note-tab:nth-child(1) {
- transform: translate3d(var(--tab-first-item-horiz-offset), 0, 0);
-}
-
:root .tab-row-widget .note-tab .note-tab-icon {
padding-inline-end: 5px; /* The gap between the icon and the title */
}
diff --git a/apps/client/src/widgets/tab_row.ts b/apps/client/src/widgets/tab_row.ts
index b49c0feda1..ad09ae129a 100644
--- a/apps/client/src/widgets/tab_row.ts
+++ b/apps/client/src/widgets/tab_row.ts
@@ -18,7 +18,6 @@ const isDesktop = utils.isDesktop();
const TAB_CONTAINER_MIN_WIDTH = 100;
const TAB_CONTAINER_MAX_WIDTH = 240;
-const TAB_CONTAINER_LEFT_PADDING = 5;
const SCROLL_BUTTON_WIDTH = 36;
const NEW_TAB_WIDTH = 36;
const MIN_FILLER_WIDTH = isDesktop ? 50 : 15;
@@ -534,7 +533,7 @@ export default class TabRowWidget extends BasicWidget {
this.setScrollButtonVisibility(false);
}
- const marginWidth = (numberOfTabs - 1) * MARGIN_WIDTH + TAB_CONTAINER_LEFT_PADDING;
+ const marginWidth = (numberOfTabs - 1) * MARGIN_WIDTH;
const targetWidth = (tabsContainerWidth - marginWidth) / numberOfTabs;
const clampedTargetWidth = Math.max(TAB_CONTAINER_MIN_WIDTH, Math.min(TAB_CONTAINER_MAX_WIDTH, targetWidth));
const flooredClampedTargetWidth = Math.floor(clampedTargetWidth);
@@ -560,7 +559,7 @@ export default class TabRowWidget extends BasicWidget {
getTabPositions() {
const tabPositions: number[] = [];
- let position = TAB_CONTAINER_LEFT_PADDING;
+ let position = 0;
this.tabWidths.forEach((width) => {
tabPositions.push(position);
position += width + MARGIN_WIDTH;