mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-17 05:20:55 +00:00
🎛️ feat: Close the Data-Level Click UI Gaps in the ClickHouse Theme (#16379)
* feat: close the data-level Click UI gaps in the ClickHouse theme
Set the theme values Click UI defines that the ClickHouse theme still left
at LibreChat defaults:
- controlHeight 2rem (genericMenu.panel.size.height), spaceCompact 0.5rem
(button.basic.space.gap), spaceNormal 1rem (button.basic.space.x) and
motionFast 100ms (transition.default).
- Light ring-primary to outline.default #437eef, matching the dark mode
ring, which already used outline.default.
- Light surface-overlay to dialog.color.opaqueBackground #151515.
- Dark surface-inverted to Click UI's primary fill #faff69 with its hover
and #1f1f1c label, which is also its checked checkbox and switch colour.
* fix: keep the shared spacing roles at LibreChat's values in the ClickHouse theme
spaceNormal and spaceCompact are not control-only: spaceNormal pads the user
message and queued-steer bubbles, and spaceCompact is the composer send
button's inner padding. Raising them to Click UI's button padding and gap
widened the bubbles and shrank the send icon's box. Keep both at the defaults;
0.75rem is already Click UI's field padding.
(cherry picked from commit 6d54d07ac1)
Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16379
This commit is contained in:
parent
bdd2d4ef8d
commit
5eed7d5ff2
3 changed files with 51 additions and 5 deletions
|
|
@ -109,6 +109,27 @@ test.describe('ClickHouse theme shape', () => {
|
|||
expect(await page.evaluate(() => localStorage.getItem('theme-definition'))).toBeNull();
|
||||
});
|
||||
|
||||
test('theme controls take Click UI control height, checked fill and focus outline @scenario:clickhouse-controls-follow-click-ui', async ({
|
||||
page,
|
||||
}) => {
|
||||
await storeClickHouse(page);
|
||||
|
||||
await openMentionMenu(page);
|
||||
await expect(page.locator('html')).toHaveAttribute('data-theme', 'clickhouse');
|
||||
const mode = await resolvedMode(page);
|
||||
|
||||
/** `genericMenu.panel.size.height` and `transition.default`; the shared spacing role that
|
||||
* also pads message bubbles keeps LibreChat's 12px. */
|
||||
expect(await probeStyle(page, 'h-theme-control', 'height')).toBe('32px');
|
||||
expect(await probeStyle(page, 'px-theme-normal', 'padding-left')).toBe('12px');
|
||||
expect(await probeStyle(page, 'duration-theme-fast', 'transition-duration')).toBe('0.1s');
|
||||
/** The checked checkbox and switch fill, and `outline.default`. */
|
||||
const fill = mode === 'light' ? 'rgb(21, 21, 21)' : 'rgb(250, 255, 105)';
|
||||
const ring = mode === 'light' ? 'rgb(67, 126, 239)' : 'rgb(250, 255, 105)';
|
||||
expect(await probeStyle(page, 'bg-surface-inverted', 'background-color')).toBe(fill);
|
||||
expect(await probeStyle(page, 'ring-2 ring-ring-primary', 'box-shadow')).toContain(ring);
|
||||
});
|
||||
|
||||
test('monospace text under the ClickHouse theme leads with Inconsolata @scenario:clickhouse-mono-font-leads-with-inconsolata', async ({
|
||||
page,
|
||||
}) => {
|
||||
|
|
|
|||
|
|
@ -357,12 +357,35 @@ describe('clickhouse theme definition', () => {
|
|||
'shadowXl',
|
||||
'shadow2xl',
|
||||
'elevationSurface',
|
||||
'controlHeight',
|
||||
'motionFast',
|
||||
] as const;
|
||||
expect(
|
||||
shapeTokens.filter((token) => clickHouse.appearance[token] === libreChat.appearance[token]),
|
||||
).toEqual([]);
|
||||
});
|
||||
|
||||
/** Click UI's control height and `transition.default`. The spacing roles keep LibreChat's
|
||||
* values: they also pad message bubbles and the composer's send button, and 0.75rem is
|
||||
* already Click UI's field padding. */
|
||||
it('sizes theme controls from Click UI and leaves the shared spacing alone', () => {
|
||||
const { appearance } = resolveTheme(clickHouseTheme, 'light');
|
||||
expect(appearance).toMatchObject({ controlHeight: '2rem', motionFast: '100ms' });
|
||||
expect(appearance.spaceCompact).toBe(defaultAppearance.spaceCompact);
|
||||
expect(appearance.spaceNormal).toBe(defaultAppearance.spaceNormal);
|
||||
});
|
||||
|
||||
/** The checkbox, switch and default button share `surface-inverted`. Dark mode takes Click UI's
|
||||
* primary fill, which its checkbox and switch also use; light keeps `#151515`, the checkbox and
|
||||
* switch colour. Every focus ring takes `outline.default`. */
|
||||
it.each([
|
||||
['light', clickHouseLightTheme, '21 21 21', '67 126 239'],
|
||||
['dark', clickHouseDarkTheme, '250 255 105', '250 255 105'],
|
||||
])('paints the %s primary fill and focus ring from Click UI', (_mode, theme, fill, ring) => {
|
||||
expect(theme['rgb-surface-inverted']).toBe(fill);
|
||||
expect(theme['rgb-ring-primary']).toBe(ring);
|
||||
});
|
||||
|
||||
it('keeps the brand yellow as the dark-mode accent and link', () => {
|
||||
expect(clickHouseDarkTheme['rgb-accent-primary']).toBe('250 255 105');
|
||||
expect(clickHouseDarkTheme['rgb-surface-submit']).toBe('250 255 105');
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ export const clickHouseLightTheme: IThemeRGB = {
|
|||
'rgb-accent-primary-hover': '50 50 50', // #323232 (palette.neutral.712)
|
||||
|
||||
// Ring colors
|
||||
'rgb-ring-primary': '21 21 21', // #151515 (accent.default)
|
||||
'rgb-ring-primary': '67 126 239', // #437eef (outline.default)
|
||||
|
||||
// Header colors
|
||||
'rgb-header-primary': '255 255 255', // #ffffff (background.default)
|
||||
|
|
@ -70,7 +70,7 @@ export const clickHouseLightTheme: IThemeRGB = {
|
|||
'rgb-surface-tertiary': '246 247 250', // #f6f7fa (background.muted)
|
||||
'rgb-surface-tertiary-alt': '255 255 255', // #ffffff (background.default)
|
||||
'rgb-surface-dialog': '255 255 255', // #ffffff (background.default)
|
||||
'rgb-surface-overlay': '83 87 95', // #53575f (palette.slate.700)
|
||||
'rgb-surface-overlay': '21 21 21', // #151515 (dialog.color.opaqueBackground, lch(6.7738 0 none))
|
||||
'rgb-surface-submit': '21 21 21', // #151515 (accent.default)
|
||||
'rgb-surface-submit-hover': '50 50 50', // #323232 (palette.neutral.712)
|
||||
'rgb-surface-destructive': '193 0 0', // #c10000 (palette.danger.600)
|
||||
|
|
@ -198,9 +198,9 @@ export const clickHouseDarkTheme: IThemeRGB = {
|
|||
'rgb-surface-chat': '31 31 28', // #1f1f1c (background.default)
|
||||
'rgb-surface-code': '40 40 40', // #282828 (codeblock.darkMode.background.default)
|
||||
'rgb-surface-code-body': '40 40 40', // #282828 (codeblock.darkMode.background.default)
|
||||
'rgb-surface-inverted': '255 255 255', // #ffffff (palette.neutral.0)
|
||||
'rgb-surface-inverted-hover': '223 223 223', // #dfdfdf (palette.neutral.200)
|
||||
'rgb-text-inverted': '21 21 21', // #151515 (palette.neutral.900)
|
||||
'rgb-surface-inverted': '250 255 105', // #faff69 (button.basic.color.primary.background.default)
|
||||
'rgb-surface-inverted-hover': '252 255 150', // #fcff96 (button.basic.color.primary.background.hover)
|
||||
'rgb-text-inverted': '31 31 28', // #1f1f1c (button.basic.color.primary.text.default)
|
||||
'rgb-surface-fixed': '255 255 255', // #ffffff (palette.neutral.0, same in light and dark)
|
||||
'rgb-surface-fixed-hover': '230 231 233', // #e6e7e9 (palette.slate.100, same in light and dark)
|
||||
'rgb-text-fixed': '22 21 23', // #161517 (palette.slate.900, same in light and dark)
|
||||
|
|
@ -302,6 +302,8 @@ const clickHouseShape = {
|
|||
'"Inconsolata", ui-monospace, SFMono-Regular, Menlo, "Cascadia Mono", "Liberation Mono", Consolas, monospace',
|
||||
shadowXs: '0 2px 2px 0 rgb(0 0 0 / 0.03)', // shadow.5
|
||||
shadowSm: '0 2px 2px 0 rgb(0 0 0 / 0.03)', // shadow.5
|
||||
controlHeight: '2rem', // genericMenu.panel.size.height
|
||||
motionFast: '100ms', // transition.default
|
||||
};
|
||||
|
||||
const elevation = (alpha: number): string =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue