Skip to content

Match the conversation tab strip to Eclipse's real native colors - #106

Merged
eilonwy06 merged 4 commits into
eilonwy06:masterfrom
jmoraleda:feat/match-eclipse-tab-colors
Sep 4, 2026
Merged

Match the conversation tab strip to Eclipse's real native colors#106
eilonwy06 merged 4 commits into
eilonwy06:masterfrom
jmoraleda:feat/match-eclipse-tab-colors

Conversation

@jmoraleda

Copy link
Copy Markdown
Contributor

Reads the actual colors of Eclipse's own editor tab strip at runtime and uses them for the conversation tab strip. Also fixes a bug where those colors came out inverted under a light color theme.

Makes the panel blend into whichever Eclipse theme, OS, or desktop environment someone is running.

The tab strip's active/inactive colors were inverted in light mode.
The active tab and #toolbar/#convo-header both used --bg-soft, which
in light mode (#f3f3f3) is DARKER than the page background --bg
(#ffffff) — the opposite of dark mode, where --bg-soft (#232323) is
lighter than --bg (#1e1e1e). --bg-soft itself isn't wrong (it's shared
with cards, the composer, etc. where "distinct surface" rather than
"lighter" is the correct read) — the tab strip needed its own tokens
instead of reusing one calibrated for a different job.

Adds --tab-bg / --tab-bg-active / --tab-hover-preview / --chrome-hover,
with dark's values chosen to reproduce today's look exactly (a pure
rename, not a value change) and light's chosen so the active tab is
unambiguously the lightest thing in the strip, matching the content
pane it opens into — both rows now read as chrome sitting above that
pane, not blended into it.
…uess

tokens.css's --tab-bg / --tab-bg-active values (from the previous commit)
are still a guess at each platform's native chrome gray — authored without
a GTK display to verify against, so #ececec might not actually match any
given user's theme. This replaces the guess with the real thing where
possible: ClaudeGuiView.findEditorAreaTabColors locates the editor area's
actual CTabFolder via the E4 model (EModelService.find(ID_EDITOR_AREA, ...)
-> MPlaceholder -> MPartStack -> its SWT widget) and reads its
getBackground()/getSelectionBackground() directly — the same setters E4's
theme engine calls, so no CSS-engine round-trip is needed.

pushTheme() passes these as optional 2nd/3rd args to onTheme(), which sets
them as inline styles on :root (winning over both :root and :root.light in
the cascade). Falls back to the last successfully sampled colors when the
editor area is momentarily unreachable (e.g. zero editors open), and to
tokens.css's static values when nothing has ever been sampled — so a
missing/unusual Eclipse layout degrades to the previous commit's guess
rather than breaking.

Deliberately targets the EDITOR area specifically, not wherever this view
itself happens to be docked: Eclipse's view-stack and editor-stack active-
tab styling differ, and the editor style is the one this webview's tab
strip is designed to visually match.

Logs the sampled hex pair (+ light/dark mode) via Activator.log when Debug
mode is on, so the actual GTK values can be read back from the Error Log
view without needing a GTK display to develop against.
…needs

findEditorAreaTabColors (previous commit) uses EModelService, MApplication,
MUIElement, MPlaceholder, and MPartStack, but MANIFEST.MF never declared
Require-Bundle entries for the bundles that export them
(org.eclipse.e4.ui.workbench for EModelService, org.eclipse.e4.ui.model.workbench
for the MUIElement family). OSGi refused to resolve the classes at runtime —
NoClassDefFoundError: org/eclipse/e4/ui/model/application/ui/MUIElement —
which crashed ClaudeGuiView's instantiation entirely (a working javac pass
never caught this: it compiles with every installed plugin jar on one flat
classpath, which hides OSGi package-visibility rules).

The specific packages used (org.eclipse.e4.ui.model.application.ui and its
.advanced/.basic children) are plain Export-Package entries with no
x-friends/x-internal restriction, so this is a normal public dependency,
not discouraged access.
IPageLayout.ID_EDITOR_AREA resolves (via the MPlaceholder it's wrapped
in) to an MArea — the editor area's container — not directly to the
MPartStack that renders the actual tab folder. The previous code
assumed MPartStack and silently fell back to "unavailable" on every
real Eclipse session.

Fix by checking for MArea, then using EModelService.findElements to
search its MPartStack descendants, preferring the one tagged
org.eclipse.e4.primaryDataStack (falls back to the first live
CTabFolder-backed stack for split-editor layouts on older/newer E4
versions that might not tag it).

Also removes the now-unneeded dumpTabFolders() debug helper, and
updates tokens.css's light-theme fallback colors from a guess
(#ececec) to the real value a live GTK CTabFolder reports (#f8f8f8) —
these tokens are now only the fallback for when dynamic sampling
fails, e.g. no editors open yet at startup.
@eilonwy06
eilonwy06 merged commit cfb7bf3 into eilonwy06:master Sep 4, 2026
@jmoraleda
jmoraleda deleted the feat/match-eclipse-tab-colors branch September 5, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants