Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(desktop): refine selected chat workspace border
Josué2d7856162b43
diff --git a/control-ui/next-env.d.ts b/control-ui/next-env.d.tsindex 9edff1c7c..c4b7818fb 100644--- a/control-ui/next-env.d.ts+++ b/control-ui/next-env.d.ts@@ -1,6 +1,6 @@/// <reference types="next" />/// <reference types="next/image-types/global" />-import "./.next/types/routes.d.ts";+import "./.next/dev/types/routes.d.ts";// NOTE: This file should not be edited// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex eded39141..565e2ad6d 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.424",+ "version": "0.1.425","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.424",+ "version": "0.1.425","dependencies": {"@clerum/display-field": "file:../packages/display-field","@clerum/llm-providers": "file:../packages/llm-providers",diff --git a/control-ui/package.json b/control-ui/package.jsonindex 7d15b008c..7093f5431 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.424",+ "version": "0.1.425","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",diff --git a/desktop-app/package-lock.json b/desktop-app/package-lock.jsonindex 0e9303446..a4b05946a 100644--- a/desktop-app/package-lock.json+++ b/desktop-app/package-lock.json@@ -54,7 +54,10 @@},"../packages/desktop-app-links": {"name": "@clerum/desktop-app-links",- "version": "0.1.1"+ "version": "0.1.1",+ "devDependencies": {+ "fast-check": "^4.9.0"+ }},"node_modules/@adobe/css-tools": {"version": "4.4.4",diff --git a/desktop-app/test/native/chat-workspace-geometry.fixture.cjs b/desktop-app/test/native/chat-workspace-geometry.fixture.cjsindex f3b177f81..e876960a6 100644--- a/desktop-app/test/native/chat-workspace-geometry.fixture.cjs+++ b/desktop-app/test/native/chat-workspace-geometry.fixture.cjs@@ -12,20 +12,49 @@ function tab(title, active = false) {async function geometry(window) {return window.webContents.executeJavaScript(`(() => {+ const panel = document.querySelector('.content-panel')+ const panelStyle = getComputedStyle(panel)const workspace = document.querySelector('.chat-view-workspace').getBoundingClientRect()const tabs = document.querySelector('.chat-view-tabs').getBoundingClientRect()const active = document.querySelector('.chat-view-tab.is-active').getBoundingClientRect()const list = document.querySelector('.chat-view-tabs__list')const surface = document.querySelector('.chat-view-surface').getBoundingClientRect()const surfaceStyle = getComputedStyle(document.querySelector('.chat-view-surface'))- const activeStyle = getComputedStyle(document.querySelector('.chat-view-tab.is-active'))+ const activeTab = document.querySelector('.chat-view-tab.is-active')+ const activeStyle = getComputedStyle(activeTab)+ const activeSeamStyle = getComputedStyle(activeTab, '::after')+ const activeSelectStyle = getComputedStyle(+ document.querySelector('.chat-view-tab.is-active .chat-view-tab__select')+ )+ const activeCloseStyle = getComputedStyle(+ document.querySelector('.chat-view-tab.is-active .chat-view-tab__close')+ )return {activeBottom: active.bottom,+ activeBackground: activeStyle.backgroundColor,+ activeBorderBottom: activeStyle.borderBottomColor,+ activeBorderBottomStyle: activeStyle.borderBottomStyle,+ activeBorderBottomWidth: activeStyle.borderBottomWidth,activeBorderTop: activeStyle.borderTopColor,+ activeCloseBackground: activeCloseStyle.backgroundColor,+ activeSeamBackground: activeSeamStyle.backgroundColor,+ activeSeamBottom: activeSeamStyle.bottom,+ activeSeamHeight: activeSeamStyle.height,+ activeSeamPosition: activeSeamStyle.position,+ activeSelectBackground: activeSelectStyle.backgroundColor,listClientWidth: list.clientWidth,listOverflowX: getComputedStyle(list).overflowX,listScrollWidth: list.scrollWidth,+ panelPaddingLeft: panelStyle.paddingLeft,+ surfaceBackground: surfaceStyle.backgroundColor,+ surfaceBorderBottom: surfaceStyle.borderBottomColor,+ surfaceBorderBottomStyle: surfaceStyle.borderBottomStyle,surfaceBorderTop: surfaceStyle.borderTopColor,+ surfaceBorderLeft: surfaceStyle.borderLeftColor,+ surfaceBorderLeftStyle: surfaceStyle.borderLeftStyle,+ surfaceBorderRight: surfaceStyle.borderRightColor,+ surfaceBorderRightStyle: surfaceStyle.borderRightStyle,+ surfacePaddingLeft: surfaceStyle.paddingLeft,surfaceTop: surface.top,surfaceWidth: surface.width,tabsBottom: tabs.bottom,@@ -34,12 +63,22 @@ async function geometry(window) {})()`)}+async function hover(window, selector) {+ const point = await window.webContents.executeJavaScript(`(() => {+ const rect = document.querySelector(${JSON.stringify(selector)}).getBoundingClientRect()+ return { x: Math.round(rect.left + rect.width / 2), y: Math.round(rect.top + rect.height / 2) }+ })()`)+ window.webContents.sendInputEvent({ type: 'mouseMove', ...point })+ await new Promise(resolve => setTimeout(resolve, 200))+}+app.whenReady().then(async () => {const window = new BrowserWindow({ show: true, x: -10000, y: -10000, width: 1000, height: 700 })try {+ const tokens = readFileSync(path.join(__dirname, '../../ui/src/styles/tokens.css'), 'utf8')const css = readFileSync(path.join(__dirname, '../../ui/src/styles.css'), 'utf8')- const html = `<!doctype html><style>${css}</style>- <main style="width:100%;height:600px">+ const html = `<!doctype html><style>${tokens}\n${css}</style>+ <main class="content-panel content-panel--agent-chat" style="width:100%;height:600px"><section class="chat-view-workspace"><div class="chat-view-tabs" role="toolbar"><div class="chat-view-tabs__list">${tab('First chat', true)}@@ -66,6 +105,61 @@ app.whenReady().then(async () => {wide.surfaceBorderTop,'tab and surface share accent treatment')+ assert.equal(wide.panelPaddingLeft, '9px', 'outer left spacing is half of the prior margin')+ assert.equal(wide.surfacePaddingLeft, '14px', 'surface adds one more content padding unit')+ assert.equal(wide.surfaceBorderTop, 'rgba(67, 119, 250, 0.25)', 'accent is 25% opaque')+ assert.equal(wide.surfaceBorderLeftStyle, 'solid', 'surface owns its left border')+ assert.equal(wide.surfaceBorderRightStyle, 'solid', 'surface owns its right border')+ assert.equal(wide.surfaceBorderLeft, wide.surfaceBorderTop, 'left border shares the accent')+ assert.equal(wide.surfaceBorderRight, wide.surfaceBorderTop, 'right border shares the accent')+ assert.equal(wide.surfaceBorderBottomStyle, 'solid', 'surface owns its bottom border')+ assert.equal(wide.surfaceBorderBottom, wide.surfaceBorderTop, 'bottom border shares the accent')+ assert.equal(wide.activeBorderBottomStyle, 'none', 'active tab has no bottom border')+ assert.equal(wide.activeBorderBottomWidth, '0px', 'active tab bottom edge has no width')+ assert.equal(wide.activeSeamPosition, 'absolute', 'active tab owns the shared seam cover')+ assert.equal(wide.activeSeamBottom, '-1px', 'seam cover overlaps the conversation top border')+ assert.equal(wide.activeSeamHeight, '1px', 'seam cover masks only the shared border row')+ assert.equal(+ wide.activeSeamBackground,+ wide.activeBackground,+ 'conversation top border is hidden beneath the active tab'+ )++ await hover(window, '.chat-view-tab.is-active .chat-view-tab__close')+ const closeHover = await geometry(window)+ assert.notEqual(+ closeHover.activeBackground,+ wide.activeBackground,+ 'hovering the close area fills the whole tab'+ )+ assert.equal(+ closeHover.activeSelectBackground,+ 'rgba(0, 0, 0, 0)',+ 'the label button does not own a partial hover fill'+ )+ assert.equal(+ closeHover.activeCloseBackground,+ 'rgba(0, 0, 0, 0)',+ 'the close button does not own a partial hover fill'+ )+ assert.equal(+ closeHover.activeSeamBackground,+ closeHover.activeBackground,+ 'the seam cover follows the complete tab hover fill'+ )++ await hover(window, '.chat-view-tab.is-active .chat-view-tab__select')+ const labelHover = await geometry(window)+ assert.equal(+ labelHover.activeBackground,+ closeHover.activeBackground,+ 'label and close hover fill the same complete tab surface'+ )+ assert.equal(+ labelHover.activeSelectBackground,+ 'rgba(0, 0, 0, 0)',+ 'the label remains transparent over the complete tab hover fill'+ )window.setSize(420, 700)await new Promise(resolve => setTimeout(resolve, 50))@@ -77,6 +171,8 @@ app.whenReady().then(async () => {'narrow surface stays full width')assert.ok(narrow.surfaceTop <= narrow.activeBottom + 1, 'narrow active tab keeps its seam')+ assert.equal(narrow.surfaceBorderLeftStyle, 'solid', 'narrow surface keeps its left border')+ assert.equal(narrow.surfaceBorderRightStyle, 'solid', 'narrow surface keeps its right border')console.log('chat workspace native geometry fixture: PASS')app.exit(0)diff --git a/desktop-app/ui/src/components/ChatViewWorkspace/ChatViewWorkspace.test.tsx b/desktop-app/ui/src/components/ChatViewWorkspace/ChatViewWorkspace.test.tsxindex 89037bb2e..d3fb984ab 100644--- a/desktop-app/ui/src/components/ChatViewWorkspace/ChatViewWorkspace.test.tsx+++ b/desktop-app/ui/src/components/ChatViewWorkspace/ChatViewWorkspace.test.tsx@@ -19,7 +19,10 @@ const tabs = [beforeEach(() => {const style = document.createElement('style')style.dataset.testStyles = 'chat-workspace'- style.textContent = `:root { --accent: #3b82f6; --surface-strong: #111827; }+ style.textContent = `${readFileSync(+ path.join(process.cwd(), 'ui', 'src', 'styles', 'tokens.css'),+ 'utf8'+ )}${readFileSync(path.join(process.cwd(), 'ui', 'src', 'styles.css'), 'utf8')}`document.head.append(style)})@@ -56,6 +59,10 @@ describe('ChatViewWorkspace', () => {expect(surface.contains(screen.getByTestId('chat-state'))).toBe(true)expect(getComputedStyle(list).overflowX).toBe('auto')expect(getComputedStyle(surface).borderTopStyle).toBe('solid')+ expect(getComputedStyle(surface).borderLeftStyle).toBe('solid')+ expect(getComputedStyle(surface).borderRightStyle).toBe('solid')+ expect(getComputedStyle(surface).borderBottomStyle).toBe('solid')+ expect(getComputedStyle(surface).paddingLeft).toBe('var(--space-3)')expect(container.querySelector('.chat-view-tab.is-active')).toBeTruthy()})diff --git a/desktop-app/ui/src/styles.css b/desktop-app/ui/src/styles.cssindex 20ceda55f..41a76a456 100644--- a/desktop-app/ui/src/styles.css+++ b/desktop-app/ui/src/styles.css@@ -2202,7 +2202,7 @@ h3 {overflow: hidden;min-height: 0;height: 100vh;- padding: var(--space-4) var(--space-4) 0;+ padding: var(--space-4) var(--space-4) 0 calc(var(--space-4) / 2);gap: 0;}@@ -14927,13 +14927,37 @@ pre {flex: 0 0 auto;max-width: 220px;min-width: 0;+ transition: background var(--motion-fast);}.chat-view-tab.is-active {background: var(--surface-strong);- border-color: var(--accent);- border-bottom-color: var(--surface-strong);+ border-color: var(--chat-view-selected-border);+ border-bottom: 0;margin-bottom: -1px;+ position: relative;+ z-index: 1;+}++.chat-view-tab.is-active::after {+ background: inherit;+ bottom: -1px;+ content: '';+ height: 1px;+ left: 0;+ pointer-events: none;+ position: absolute;+ right: 0;+}++.chat-view-tab:hover {+ background: var(--surface-hover);+}++.chat-view-tab .chat-view-tab__select.ui-button:hover:enabled,+.chat-view-tab .chat-view-tab__close.ui-button:hover:enabled {+ background: transparent;+ border-color: transparent;}.chat-view-tab__select {@@ -14956,6 +14980,8 @@ pre {}.chat-view-workspace {+ --chat-view-selected-border: rgba(var(--accent-rgb), 0.25);+display: flex;flex: 1 1 0;flex-direction: column;@@ -14966,9 +14992,9 @@ pre {.chat-view-surface {background: var(--surface-strong);- border-top-color: var(--accent);- border-top-style: solid;- border-top-width: 1px;+ border-color: var(--chat-view-selected-border);+ border-style: solid;+ border-width: 1px;border-radius: 0 var(--radius-sm) 0 0;display: flex;flex: 1 1 0;@@ -14976,6 +15002,7 @@ pre {min-height: 0;min-width: 0;overflow: hidden;+ padding-left: var(--space-3);width: 100%;}diff --git a/package-lock.json b/package-lock.jsonindex 6a43c5ebb..d491bb7fe 100644--- a/package-lock.json+++ b/package-lock.json@@ -727,7 +727,6 @@"integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==","dev": true,"license": "MIT",- "peer": true,"dependencies": {"undici-types": "~7.19.0"}@@ -909,7 +908,6 @@"integrity": "sha512-hr4ihw+DBqcvrsEDioRO31Z17x71pUYoNe/4h6Z0wB72p7MU7/9gH8Q3s12NFhHPfYBBOV3qyfUxmr/Yn3shnQ==","dev": true,"license": "MIT",- "peer": true,"dependencies": {"env-paths": "^2.2.1","import-fresh": "^3.3.0",@@ -1516,7 +1514,6 @@"integrity": "sha512-8c3mgTe0ASwWAJK+78dpviD+A8EqhndQPUBpNUIPt6+xWlIigCwfN01lWr9MAede4uqXGTEKeQWTvzb3vjia0Q==","dev": true,"license": "MIT",- "peer": true,"bin": {"prettier": "bin/prettier.cjs"},diff --git a/profile-ui/package-lock.json b/profile-ui/package-lock.jsonindex 728838ce2..477de18d0 100644--- a/profile-ui/package-lock.json+++ b/profile-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-profile-ui",- "version": "0.1.120",+ "version": "0.1.121","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-profile-ui",- "version": "0.1.120",+ "version": "0.1.121","dependencies": {"@clerum/desktop-app-links": "file:../packages/desktop-app-links","next": "16.2.11",@@ -26,7 +26,10 @@},"../packages/desktop-app-links": {"name": "@clerum/desktop-app-links",- "version": "0.1.1"+ "version": "0.1.1",+ "devDependencies": {+ "fast-check": "^4.9.0"+ }},"node_modules/@acemir/cssom": {"version": "0.9.31",@@ -96,6 +99,7 @@"integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"@babel/helper-validator-identifier": "^7.29.7","js-tokens": "^4.0.0",@@ -111,6 +115,7 @@"integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==","dev": true,"license": "MIT",+ "peer": true,"engines": {"node": ">=6.9.0"}@@ -230,7 +235,6 @@}],"license": "MIT",- "peer": true,"engines": {"node": ">=20.19.0"},@@ -279,7 +283,6 @@}],"license": "MIT",- "peer": true,"engines": {"node": ">=20.19.0"}@@ -1306,7 +1309,8 @@"resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz","integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==","dev": true,- "license": "MIT"+ "license": "MIT",+ "peer": true},"node_modules/@types/chai": {"version": "5.2.3",@@ -1339,7 +1343,6 @@"integrity": "sha512-oH72nZRfDv9lADUBSo104Aq7gPHpQZc4BTx38r9xf9pg5LfP6EzSyH2n7qFmmxRQXh7YlUXODcYsg6PuTDSxGg==","dev": true,"license": "MIT",- "peer": true,"dependencies": {"undici-types": "~7.16.0"}@@ -1357,7 +1360,6 @@"integrity": "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw==","dev": true,"license": "MIT",- "peer": true,"dependencies": {"@types/prop-types": "*","csstype": "^3.2.2"@@ -1369,7 +1371,6 @@"integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==","dev": true,"license": "MIT",- "peer": true,"peerDependencies": {"@types/react": "^18.0.0"}@@ -1503,6 +1504,7 @@"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==","dev": true,"license": "MIT",+ "peer": true,"engines": {"node": ">=8"}@@ -1513,6 +1515,7 @@"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==","dev": true,"license": "MIT",+ "peer": true,"engines": {"node": ">=10"},@@ -1713,7 +1716,8 @@"resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz","integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==","dev": true,- "license": "MIT"+ "license": "MIT",+ "peer": true},"node_modules/entities": {"version": "8.0.0",@@ -1858,7 +1862,6 @@"integrity": "sha512-0+MoQNYyr2rBHqO1xilltfDjV9G7ymYGlAUazgcDLQaUf8JDHbuGwsxN6U9qWaElZ4w1B2r7yEGIL3GdeW3Rug==","dev": true,"license": "MIT",- "peer": true,"dependencies": {"@acemir/cssom": "^0.9.31","@asamuzakjp/dom-selector": "^6.8.1",@@ -2183,6 +2186,7 @@"integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==","dev": true,"license": "MIT",+ "peer": true,"bin": {"lz-string": "bin/bin.js"}@@ -2338,7 +2342,6 @@"integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==","dev": true,"license": "MIT",- "peer": true,"engines": {"node": ">=12"},@@ -2380,6 +2383,7 @@"integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"ansi-regex": "^5.0.1","ansi-styles": "^5.0.0",@@ -2404,7 +2408,6 @@"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz","integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==","license": "MIT",- "peer": true,"dependencies": {"loose-envify": "^1.1.0"},@@ -2417,7 +2420,6 @@"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz","integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==","license": "MIT",- "peer": true,"dependencies": {"loose-envify": "^1.1.0","scheduler": "^0.23.2"@@ -2431,7 +2433,8 @@"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz","integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==","dev": true,- "license": "MIT"+ "license": "MIT",+ "peer": true},"node_modules/redent": {"version": "3.0.0",@@ -2781,7 +2784,6 @@"integrity": "sha512-pn+CFpM0lwDeKwmOq1ZaBK/9sjorZcgqxki6MbY/jPEVd9vichIlmlD4HmQ5wdP5EgqQCFRaACBxMC7uEGc6lQ==","dev": true,"license": "MIT",- "peer": true,"dependencies": {"lightningcss": "^1.33.0","picomatch": "^4.0.5",diff --git a/profile-ui/package.json b/profile-ui/package.jsonindex a42c74fed..d13d230b7 100644--- a/profile-ui/package.json+++ b/profile-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-profile-ui",- "version": "0.1.120",+ "version": "0.1.121","private": true,"scripts": {"dev": "next dev",