Skip to content

Commit c193fcd

Browse files
committed
allow file tabs to be smaller again
- we didn't do this before so they are also readable, but with the "new" side tabs, that argument no longer applies
1 parent 847ab14 commit c193fcd

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/packages/frontend/components/sortable-tabs.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,15 @@ export function SortableTabs(props: Props) {
9292
lastRef.current.length = items.length;
9393
return last.itemWidth;
9494
}
95+
// resize?.width - 46 - the minus 46 is to take into account the "..." dropdown.
9596
const itemWidth =
9697
Math.max(
97-
180,
98-
Math.min(250 + 65, (resize?.width ?? 0) / Math.max(1, items.length))
99-
) - 70; // the constant accounts for the margin and x for an antd tab.
98+
80,
99+
Math.min(
100+
250 + 65,
101+
((resize?.width ?? 500) - 46 ?? 0) / Math.max(1, items.length),
102+
),
103+
) - 55; // the constant accounts for the margin and x for an antd tab.
100104
lastRef.current = {
101105
width: resize.width ?? 0,
102106
length: items.length,

src/packages/frontend/project/page/file-tab.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ export function FileTab(props: Readonly<Props>) {
320320

321321
// how to read: default color -> style for component -> override color if there is activity
322322
const icon_style: CSSProperties = {
323+
marginRight: "2px",
324+
marginLeft: "-10px",
323325
color: COLORS.FILE_ICON,
324326
...props.iconStyle,
325327
...(has_activity ? { color: "orange" } : undefined),
@@ -473,11 +475,10 @@ export function FileTab(props: Readonly<Props>) {
473475
}
474476

475477
const LABEL_STYLE: CSS = {
476-
maxWidth: "250px",
477478
overflow: "hidden",
478-
textOverflow: "ellipsis",
479+
//textOverflow: "ellipsis",
480+
margin: "auto",
479481
whiteSpace: "nowrap",
480-
marginRight: "-15px", // this makes a lot more of the filename visible by undoing the antd tab spacing.
481482
} as const;
482483

483484
const FULLPATH_LABEL_STYLE: CSS = {

src/packages/frontend/project/page/file-tabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Label({ path, project_id, label }) {
3131
path={path}
3232
label={label}
3333
noPopover={active != null}
34-
style={width != null ? { width } : undefined}
34+
style={width != null ? { width, marginRight: "-10px" } : undefined}
3535
/>
3636
);
3737
}

0 commit comments

Comments
 (0)