Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,962 changes: 1,987 additions & 5,975 deletions apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions apps/desktop/scripts/vite-client-plugin-slots.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@

import assert from 'node:assert/strict';
import { mkdir, mkdtemp, readFile, readdir, rm, writeFile } from 'node:fs/promises';
import { createRequire } from 'node:module';
import { resolve, join } from 'node:path';
import { pathToFileURL } from 'node:url';
import { test } from 'node:test';
import { build, resolveConfig } from 'vite';
import { build, normalizePath, resolveConfig } from 'vite';

// Exercise the actual Desktop resolution graph: isolated Slot unit tests cannot
// detect two React Context instances created by source/dist entry-point mixing.
Expand Down Expand Up @@ -66,7 +67,9 @@ test('renderer build emits KaTeX fonts as CSP-compatible files', async () => {
try {
const entry = join(root, 'entry.js');
const outDir = join(root, 'out');
await writeFile(entry, "import 'katex/dist/katex.min.css';\n");
const uiRequire = createRequire(join(desktop, '../../packages/ui/package.json'));
const katexCss = normalizePath(uiRequire.resolve('katex/dist/katex.min.css'));
await writeFile(entry, `import ${JSON.stringify(katexCss)};\n`);
const config = await resolveConfig({ configFile: join(desktop, 'vite.config.ts') }, 'build');
await build({
configFile: false,
Expand Down
15 changes: 10 additions & 5 deletions apps/desktop/src/main/__tests__/ink-ladder-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,20 @@ const SOURCE_EXTENSIONS = ['.css', '.ts', '.tsx'];

const RETIRED_INK = ['--foreground-secondary', '--foreground-dimmed'];

// These reads intentionally consume layout declarations, never colours.
// These reads intentionally consume layout and font declarations, never colours.
// Keep this exact: an unknown property must still fail the palette guard.
const LAYOUT_DECLARATION_READS = new Set([
const NON_COLOR_DECLARATION_READS = new Set([
'--maka-session-workbar-width', // Restore the inline width declaration after a drag.
'--maka-focused-composer-space', // Assert the measured pixel clearance in the layout story.
'--agents-content-area-gap', // Assert the titlebar gutter reserves the plate seam in the shell story.
'--font-family-body',
'--font-family-code',
]);

function unapprovedCustomPropertyReads(source: string): string[] {
return [...withoutComments(source).matchAll(/getPropertyValue\(\s*['"`](--[a-z0-9-]+)/g)]
.map((match) => match[1]!)
.filter((name) => !LAYOUT_DECLARATION_READS.has(name));
.filter((name) => !NON_COLOR_DECLARATION_READS.has(name));
}

async function sourceFilesUnder(root: string): Promise<string[]> {
Expand Down Expand Up @@ -232,14 +234,17 @@ describe('mode expression', () => {
);
});

it('allows the explicit layout reads without admitting palette or unknown properties', () => {
it('allows the explicit layout and font reads without admitting palette or unknown properties', () => {
assert.deepEqual(unapprovedCustomPropertyReads(`
frame.style.getPropertyValue('--maka-session-workbar-width');
getComputedStyle(frame).getPropertyValue('--maka-focused-composer-space');
getComputedStyle(frame).getPropertyValue('--font-family-body');
getComputedStyle(frame).getPropertyValue('--font-family-code');
getComputedStyle(frame).getPropertyValue('--foreground');
getComputedStyle(frame).getPropertyValue("--background");
getComputedStyle(frame).getPropertyValue('--maka-brand');
frame.style.getPropertyValue('--maka-unknown-width');
`), ['--foreground', '--background', '--maka-brand', '--maka-unknown-width']);
getComputedStyle(frame).getPropertyValue('--font-family-unknown');
`), ['--foreground', '--background', '--maka-brand', '--maka-unknown-width', '--font-family-unknown']);
});
});
Loading
Loading