Repository navigation
fix(workbench): unify composer surfaces only in Codex light #9202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
maxliux5
wants to merge
2
commits into
loopx-project:main
Choose a base branch
from
maxliux5:codex/workbench-composer-surface
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+80
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import { test } from 'node:test'; | ||
| import assert from 'node:assert/strict'; | ||
| import { readFileSync } from 'node:fs'; | ||
| import { tsImport } from 'tsx/esm/api'; | ||
| import { launchBrowser } from '../harness.mjs'; | ||
|
|
||
| const { PALETTES } = await tsImport('../../web/src/appearance.ts', import.meta.url); | ||
| const css = readFileSync(new URL('../../web/src/styles.css', import.meta.url), 'utf8'); | ||
|
|
||
| // The scope is intentional: only Codex light changes. Unrelated themes retain | ||
| // their existing surface, filled queue rows and desktop/mobile material. | ||
| test('composer correction stays in Codex light across every shipped palette', async t => { | ||
| const browser = await launchBrowser(); | ||
| const page = await browser.newPage(); | ||
| try { | ||
| for (const { id } of PALETTES) for (const theme of ['light', 'dark']) for (const width of [1280, 390]) { | ||
| await t.test(`${id} ${theme} ${width}`, async () => { | ||
| await page.setViewportSize({ width, height: 844 }); | ||
| await page.emulateMedia({ colorScheme: theme }); | ||
| await page.setContent(`<html data-palette="${id}" data-theme="${theme}"><head><style>${css}</style></head><body> | ||
| <main class="main"><div class="composer"><div class="composer-box"> | ||
| <div class="composer-context">Workspace</div> | ||
| <div class="queue"><div class="queue-item"><span class="queue-badge">Queued</span>Keep the queued message readable.</div></div> | ||
| <textarea aria-label="Draft"></textarea> | ||
| </div></div></main></body></html>`); | ||
| const actual = await page.evaluate(() => { | ||
| const style = selector => getComputedStyle(document.querySelector(selector)); | ||
| const probe = document.createElement('div'); document.body.append(probe); | ||
| const token = (property, name) => { | ||
| probe.style.setProperty(property, `var(${name})`); | ||
| return getComputedStyle(probe).getPropertyValue(property); | ||
| }; | ||
| const values = { | ||
| fill: style('.composer-box').backgroundColor, queue: style('.queue-item').backgroundColor, | ||
| context: style('.composer-context').backgroundColor, shadow: style('.composer-box').boxShadow, | ||
| blur: style('.composer-box').backdropFilter, queueBottom: style('.queue').paddingBottom, | ||
| canvas: token('background-color', '--bg'), surface: token('background-color', '--surface'), | ||
| row: token('background-color', '--surface-2'), glass: token('background-color', '--glass-bg'), | ||
| halo: token('box-shadow', '--glass-halo'), glassShadow: token('box-shadow', '--glass-shadow'), | ||
| glassFilter: token('backdrop-filter', '--glass-filter'), | ||
| }; | ||
| probe.remove(); return values; | ||
| }); | ||
| if (id === 'codex' && theme === 'light') { | ||
| assert.equal(actual.fill, actual.canvas); | ||
| assert.equal(actual.queue, 'rgba(0, 0, 0, 0)'); | ||
| assert.equal(actual.context, 'rgba(0, 0, 0, 0)'); | ||
| assert.equal(actual.shadow, 'none'); | ||
| assert.equal(actual.blur, 'none'); | ||
| assert.equal(actual.queueBottom, '8px'); | ||
| } else { | ||
| assert.equal(actual.fill, width >= 900 ? actual.surface : actual.glass); | ||
| assert.equal(actual.queue, actual.row); | ||
| assert.equal(actual.context, actual.row); | ||
| assert.equal(actual.shadow, width >= 900 ? actual.halo : actual.glassShadow); | ||
| assert.equal(actual.blur, width >= 900 ? 'none' : actual.glassFilter); | ||
| assert.equal(actual.queueBottom, '0px'); | ||
| } | ||
| }); | ||
| } | ||
| } finally { await browser.close(); } | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Codex 浅色边框覆盖附件拖放提示色。向真实 Composer 派发一个普通本地附件的 dragover,组件进入 drag-over 并显示松开提示。两档视口的虚线均保留,但基线的近黑提示边框 #0D0D0D 被浅色作用域覆盖为 #EBEBE9。桌面边框与输入背景的对比从约 18.6:1 降到 1.19:1,接收范围几乎融进白色画布。 让浅色背景规则保留普通状态的细边框,同时让拖放状态继续使用现有 --text 边框。可以限制默认边框选择器只匹配非拖放状态,或用低优先级作用域保留现有拖放优先级。补一条实际附件 dragover 的浅色视口回归测试。