Skip to content

Commit f239689

Browse files
authored
feat: truncate longer query names in tab titles (#120)
So that longer query names used in tab titles don't overflow into the adjacent tab titles, we now truncate them. The text is still added as a title to the span, so a user can hover it and see the full name.
1 parent 802211b commit f239689

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/modules/EditorView/EditorTabs.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,13 @@ export const EditorTabs = () => {
6969
data-test-query-editor-tab={tab.title}
7070
key={idx.toString()}
7171
tabId={idx.toString()}
72-
className={`${theme.theme === Theme.LIGHT ? "ndl-theme-light" : "ndl-theme-dark"}`}
72+
className={theme.theme === Theme.LIGHT ? "ndl-theme-light" : "ndl-theme-dark"}
7373
>
7474
<div className="flex justify-center items-center">
75-
<span style={{ maxWidth: "7rem" }}>{tab.title}</span>
75+
<span className="truncate" style={{ maxWidth: "7rem" }} title={tab.title}>
76+
{tab.title}
77+
</span>
78+
7679
{useStore.getState().tabs.length > 1 && (
7780
<XMarkIconOutline
7881
data-test-close-icon-query-editor-tab

0 commit comments

Comments
 (0)