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
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ License: MIT

Maka includes an ejected adaptation of Astryx ChatReasoning v0.1.9 in
`packages/ui/src/astryx-chat-reasoning.tsx` and generated theme artifacts in
`apps/desktop/src/renderer/astryx-theme/`, based on Astryx theme-neutral v0.6.1.
`apps/desktop/src/renderer/astryx-theme/`, based on Astryx theme-neutral v0.6.2.
Maka also redistributes
`patches/@astryxdesign+core+0.6.1.patch`, which modifies the MIT-licensed Astryx
`patches/@astryxdesign+core+0.6.2.patch`, which modifies the MIT-licensed Astryx
core package. The following MIT License applies to that material:

MIT License
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
},
"devDependencies": {
"@ant-design/icons-svg": "4.6.0",
"@astryxdesign/core": "0.6.1",
"@astryxdesign/theme-neutral": "0.6.1",
"@astryxdesign/core": "0.6.2",
"@astryxdesign/theme-neutral": "0.6.2",
"@babel/parser": "7.29.7",
"@fontsource-variable/geist": "^5.3.0",
"@fontsource-variable/geist-mono": "^5.3.0",
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/resources/licenses/npm/THIRD_PARTY_NOTICES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ SOFTWARE.

================================================================================

Package: @astryxdesign/core@0.6.1
Package: @astryxdesign/core@0.6.2
Declared license: MIT
Selected license: MIT
Repository: git+https://github.com/facebook/astryx.git#packages/core
Expand Down Expand Up @@ -707,7 +707,7 @@ SOFTWARE.

================================================================================

Package: @astryxdesign/theme-neutral@0.6.1
Package: @astryxdesign/theme-neutral@0.6.2
Declared license: MIT
Selected license: MIT
Repository: git+https://github.com/facebook/astryx.git#packages/themes/neutral
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/renderer/astryx-theme/maka.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @generated by `astryx theme build` — do not edit manually.
* Source: src/renderer/astryx-theme/makaTheme.ts
* Command: astryx theme build src/renderer/astryx-theme/makaTheme.ts --out src/renderer/astryx-theme/maka.css
* CLI: @astryxdesign/cli@0.6.1
* CLI: @astryxdesign/cli@0.6.2
* Core: @astryxdesign/core@0.1.0
*/

Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/renderer/astryx-theme/maka.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @generated by `astryx theme build` — do not edit manually.
* Source: src/renderer/astryx-theme/makaTheme.ts
* Command: astryx theme build src/renderer/astryx-theme/makaTheme.ts --out src/renderer/astryx-theme/maka.css
* CLI: @astryxdesign/cli@0.6.1
* CLI: @astryxdesign/cli@0.6.2
* Core: @astryxdesign/core@0.1.0
*/

Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/renderer/astryx-theme/maka.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @generated by `astryx theme build` — do not edit manually.
* Source: src/renderer/astryx-theme/makaTheme.ts
* Command: astryx theme build src/renderer/astryx-theme/makaTheme.ts --out src/renderer/astryx-theme/maka.css
* CLI: @astryxdesign/cli@0.6.1
* CLI: @astryxdesign/cli@0.6.2
* Core: @astryxdesign/core@0.1.0
*/

Expand Down
2 changes: 1 addition & 1 deletion docs/astryx-surface-file-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Generated by `scripts/generate-astryx-surface-inventory.mjs`.
Each row is one on-disk product surface file. Regenerated inventory must stay in sync with disk (coverage gate).
Generated against `@astryxdesign/core@0.6.1` (195 component exports).
Generated against `@astryxdesign/core@0.6.2` (195 component exports).

Wiki bar: Design Conventions · API Use-the-System · Theming · Container Padding.

Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@
},
"devDependencies": {
"@ai-sdk/provider-utils": "5.0.40",
"@astryxdesign/cli": "0.6.1",
"@astryxdesign/core": "0.6.1",
"@astryxdesign/cli": "0.6.2",
"@astryxdesign/core": "0.6.2",
"@biomejs/biome": "2.5.13",
"@electron/asar": "4.3.0",
"@types/node": "^26.5.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"test:dist": "node --test \"dist/**/*.test.js\""
},
"dependencies": {
"@astryxdesign/core": "0.6.1",
"@astryxdesign/core": "0.6.2",
"@maka/core": "0.1.0",
"clsx": "^2.1.1",
"katex": "0.18.7",
Expand Down
72 changes: 72 additions & 0 deletions packages/ui/src/__tests__/markdown-body.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,78 @@ it('renders multiline display math outside code for both supported delimiters',
}
});

it('renders display math inside blockquotes and list items', () => {
for (const text of ['> \\[ x + 1 \\]', '- \\[ x + 1 \\]']) {
const markup = renderToStaticMarkup(createElement(MarkdownBody, { text }));
assert.match(markup, /class="maka-math maka-math-display"/);
assert.match(markup, /class="katex-display"/);
assert.doesNotMatch(markup, /\\\[/);
}
});

it('promotes a mid-paragraph $$…$$ span to display math', () => {
const markup = renderToStaticMarkup(createElement(MarkdownBody, {
text: 'Before $$x + 1$$ after',
}));

assert.match(markup, /Before/);
assert.match(markup, /after/);
assert.match(markup, /class="maka-math maka-math-display"/);
assert.doesNotMatch(markup, /\$\$/);
});

it('keeps `$` inside link destinations literal while prose stays dollar-escaped', () => {
const markup = renderToStaticMarkup(createElement(LocaleProvider, {
locale: 'en',
children: createElement(MarkdownBody, {
text: '[priced](https://example.com/?$from$=$to$) and $z$ here',
}),
}));

assert.match(markup, /href="https:\/\/example\.com\/\?\$from\$=\$to\$"/);
assert.match(markup, /and \$z\$ here/);
assert.doesNotMatch(markup, /class="maka-math/);
});

it('renders inline math glued to digits and formulas holding escaped dollars', () => {
for (const text of ['v2\\(x + 1\\)3 done', 'cost \\(a \\$ b\\) end']) {
const markup = renderToStaticMarkup(createElement(MarkdownBody, { text }));
assert.match(markup, /class="maka-math maka-math-inline"/);
assert.doesNotMatch(markup, /\\\(|\\\)/);
}
});

it('leaves no zero-width separators around inline math with benign neighbors', () => {
for (const text of [
'the value \\(x\\) is fine',
'ends with \\(x\\)',
]) {
const markup = renderToStaticMarkup(createElement(MarkdownBody, { text }));
assert.match(markup, /class="maka-math maka-math-inline"/);
assert.doesNotMatch(markup, /\u200B/, text);
}
});

it('keeps adjacent inline formulas parseable through a separator', () => {
const markup = renderToStaticMarkup(createElement(MarkdownBody, {
text: 'compare \\(x\\)\\(y\\) here',
}));
assert.equal(
(markup.match(/class="maka-math maka-math-inline"/g) ?? []).length,
2,
);
});

it('keeps display math inside a table cell without splitting the row', () => {
const markup = renderToStaticMarkup(createElement(MarkdownBody, {
text: '| a | b |\n| --- | --- |\n| \\(x + 1\\) | \\[y + 2\\] |',
}));

assert.match(markup, /<table/);
assert.equal((markup.match(/class="maka-math maka-math-inline"/g) ?? []).length, 2);
assert.doesNotMatch(markup, /\\\(|\\\]|\\\[/);
});

it('keeps display math intact across Markdown-looking block boundaries', () => {
const bodies = [
['x + 1', '', 'y + 2'],
Expand Down
24 changes: 24 additions & 0 deletions packages/ui/src/__tests__/streaming-text.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,30 @@ test('keeps settled math stable while the live Markdown tail grows and flushes',
await act(() => root.unmount());
});

test('keeps inline math when a digit chunk lands after the committed closer', async () => {
const { container, root } = streamingRoot();

function render(text: string) {
return root.render(
<LocaleProvider locale="en">
<MarkdownBody text={text} />
</LocaleProvider>,
);
}

await act(() => render('v2 \\(x + 1\\)'));
assert.ok(container.querySelector('.maka-math .katex'));

await act(() => render('v2 \\(x + 1\\)3'));
assert.ok(container.querySelector('.maka-math .katex'));

await act(() => render('v2 \\(x + 1\\)3 done'));
assert.ok(container.querySelector('.maka-math .katex'));
assert.match(container.textContent ?? '', /3 done/);

await act(() => root.unmount());
});

test('never exposes math transport syntax as a formula crosses the display cursor', async () => {
const frames: FrameRequestCallback[] = [];
const { container, root } = streamingRoot((callback) => {
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/astryx-i18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ function chineseOverrides(locale: 'zh-CN' | 'zh-TW', astryx: typeof ASTRYX_COPY_
'@astryx.selector.placeholder': form.selectPlaceholder,
'@astryx.selector.clearLabel': form.clear,
'@astryx.numberInput.clearLabel': form.clear,
// Fallback accessible name of every unlabeled <Spinner> (0.6.2).
'@astryx.spinner.loading': shared.primitives.loading,

// App shell — the skip link is always the first focusable control, so an
// untranslated fallback pollutes every Chinese Computer Use observation.
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/markdown-body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import { getSharedUiCopy } from './shared-ui-copy.js';
import { MermaidDiagram } from './mermaid-diagram.js';
import {
createMarkdownMathCache,
MARKDOWN_MATH_PLUGINS,
MarkdownMath,
prepareMarkdownMath,
} from './markdown-math.js';
import { parseAttachmentResourceRef } from '@maka/core/attachments';
Expand All @@ -57,6 +57,7 @@ import { useAttachmentImageSource } from './attachment-image.js';
const BASE_MARKDOWN_COMPONENTS = {
link: MarkdownLink,
image: MarkdownImage,
math: MarkdownMath,
};

export const MAX_AUTOMATIC_MERMAID_DIAGRAMS = 3;
Expand Down Expand Up @@ -194,7 +195,6 @@ export function MarkdownBody(props: {
// the one combination neither half of the argument asks for.
density={density}
components={components}
inlinePlugins={MARKDOWN_MATH_PLUGINS}
isStreaming={props.streaming}
settledText={props.settledText}
transformSource={transformMathSource}
Expand Down
Loading
Loading