Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

feat(desktop-app): shrink chat-view session tabs Chrome-style instead of fixed width

Diego Zacariasff39e7b17232
diff --git a/desktop-app/ui/src/components/ChatTabs/ChatTabs.test.tsx b/desktop-app/ui/src/components/ChatTabs/ChatTabs.test.tsx
index 343c3bc2b..1cda8a8c6 100644
--- a/desktop-app/ui/src/components/ChatTabs/ChatTabs.test.tsx
+++ b/desktop-app/ui/src/components/ChatTabs/ChatTabs.test.tsx
@@ -60,9 +60,18 @@ describe('ChatTabs', () => {
const styles = readFileSync(path.join(process.cwd(), 'ui', 'src', 'styles.css'), 'utf8')
expect(styles).toMatch(/\.chat-view-tabs\s*\{[^}]*padding:\s*var\(--space-2\) 0 0;/s)
expect(styles).toMatch(/\.chat-view-tabs__scroller\s*\{[^}]*width:\s*100%;/s)
- expect(styles).toMatch(/\.chat-view-tabs__list\s*\{[^}]*width:\s*max-content;/s)
- expect(styles).toMatch(/\.chat-view-tab\s*\{[^}]*flex:\s*0 0 220px;/s)
- expect(styles).toMatch(/\.chat-view-tab\s*\{[^}]*width:\s*220px;/s)
+ expect(styles).toMatch(/\.chat-view-tabs__list\s*\{[^}]*width:\s*100%;/s)
+ expect(styles).toMatch(/\.chat-view-tab\s*\{[^}]*flex:\s*1 1 var\(--chat-tab-max\);/s)
+ expect(styles).toMatch(/\.chat-view-tab\s*\{[^}]*max-width:\s*var\(--chat-tab-max\);/s)
+ expect(styles).toMatch(/\.chat-view-tab\s*\{[^}]*min-width:\s*var\(--chat-tab-min\);/s)
+ // The active tab shrinks slower than the others so it stays legible when crowded.
+ expect(styles).toMatch(/\.chat-view-tab\.is-active\s*\{[^}]*flex-shrink:\s*0\.4;/s)
+ // The bottom shelf lives on the non-scrolling container so it survives horizontal
+ // scroll of the overflowing tabs (a shelf on the list would slide away).
+ expect(styles).toMatch(/\.chat-view-tabs::after\s*\{[^}]*z-index:\s*-1;/s)
+ expect(styles).toMatch(
+ /\.chat-view-tab:not\(\.is-active\)\s*\{[^}]*border-bottom:\s*1px solid var\(--chat-view-selected-border\);/s
+ )
expect(styles).toMatch(/\.chat-view-tab__select\s*\{[^}]*flex:\s*1 1 auto;/s)
expect(styles).toMatch(/\.chat-view-tab__label\s*\{[^}]*text-overflow:\s*ellipsis;/s)
})
diff --git a/desktop-app/ui/src/styles.css b/desktop-app/ui/src/styles.css
index 92beb1ce4..24438e621 100644
--- a/desktop-app/ui/src/styles.css
+++ b/desktop-app/ui/src/styles.css
@@ -15520,6 +15520,25 @@ pre {
z-index: 1;
}
+/* Bottom shelf of the tab strip. It lives on the non-scrolling container (not
+ the scroller/list) so it stays under the whole visible strip when the tabs
+ overflow and scroll — a shelf on the scrolling list only spans the initial
+ viewport and slides away on scroll. z-index:-1 keeps it below the opaque
+ tabs (so it only shows through the gaps between them); each inactive tab
+ draws its own matching bottom border, and the active tab omits it to notch
+ through and merge with the surface below. */
+.chat-view-tabs::after {
+ background: var(--chat-view-selected-border);
+ bottom: 0;
+ content: '';
+ height: 1px;
+ left: 0;
+ pointer-events: none;
+ position: absolute;
+ right: 0;
+ z-index: -1;
+}
+
.chat-view-tabs__scroller {
min-width: 0;
overflow-x: auto;
@@ -15534,18 +15553,7 @@ pre {
min-width: 100%;
position: relative;
transform: rotateX(180deg);
- width: max-content;
-}
-
-.chat-view-tabs__list::after {
- background: var(--chat-view-selected-border);
- bottom: 0;
- content: '';
- height: 1px;
- left: 0;
- pointer-events: none;
- position: absolute;
- right: 0;
+ width: 100%;
}
.chat-view-tab {
@@ -15554,21 +15562,24 @@ pre {
border: 1px solid var(--border-soft);
border-radius: var(--radius-sm) var(--radius-sm) 0 0;
display: flex;
- flex: 0 0 220px;
- min-width: 0;
+ flex: 1 1 var(--chat-tab-max);
+ min-width: var(--chat-tab-min);
+ max-width: var(--chat-tab-max);
transition: background var(--motion-fast);
- width: 220px;
}
.chat-view-tab:not(.is-active) {
- border-bottom: 0;
- border-color: color-mix(in srgb, var(--border-soft) 25%, transparent);
+ border-bottom: 1px solid var(--chat-view-selected-border);
+ border-left-color: color-mix(in srgb, var(--border-soft) 25%, transparent);
+ border-right-color: color-mix(in srgb, var(--border-soft) 25%, transparent);
+ border-top-color: color-mix(in srgb, var(--border-soft) 25%, transparent);
}
.chat-view-tab.is-active {
background: linear-gradient(var(--surface-strong), var(--surface-strong)), var(--panel);
border-color: var(--chat-view-selected-border);
border-bottom: 0;
+ flex-shrink: 0.4;
position: relative;
z-index: 1;
}
diff --git a/desktop-app/ui/src/styles/tokens.css b/desktop-app/ui/src/styles/tokens.css
index 146278be6..637653c63 100644
--- a/desktop-app/ui/src/styles/tokens.css
+++ b/desktop-app/ui/src/styles/tokens.css
@@ -151,6 +151,10 @@
/* Layout */
--search-bar-min-width: 320px;
--avatar-size: 40px;
+
+ /* chat-view session tabs (Chrome-style: shrink to a floor, cap at a ceiling) */
+ --chat-tab-max: 220px;
+ --chat-tab-min: 96px;
--control-bg: var(--surface-soft);
--control-bg-strong: rgba(var(--panel-rgb), 0.78);
--control-border: rgba(var(--edge-rgb), 0.56);