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
Binary file added .maka-shots/chat-code-measure-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .maka-shots/chat-code-measure-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion apps/desktop/src/renderer/maka-tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,12 @@
fallbacks are redundant. */
--maka-chat-measure: 680px;

/* Astryx's AI Chat conversation uses an 800px message area while Markdown
keeps prose at 680px and lets code/tables fill the wider container. Keep
that exception transcript-scoped so the shared Maka surfaces above do not
change width as a side effect of making source evidence readable. */
--maka-transcript-measure: 800px;

/* === settings ==========================================================
One right-edge cap for a settings row's end slot — the read-only value
and the control cluster share it, so the two kinds of row end stop at
Expand Down Expand Up @@ -1507,7 +1513,7 @@
between-turn gap (.maka-chatContent) — one density, no between/within
split. */
gap: var(--space-3);
max-width: var(--maka-chat-measure);
max-width: var(--maka-transcript-measure);
margin: 0 auto;
width: 100%;
box-sizing: border-box;
Expand Down
4 changes: 4 additions & 0 deletions packages/ui/src/markdown-body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ function MarkdownCode(props: {
<CodeBlock
code={props.code}
language={props.language}
// Markdown fences are block content. Astryx defaults to fit-content
// with a 400px floor, which leaves short-code fences visibly narrow
// even when the surrounding transcript has room to stay readable.
width="100%"
// Astryx otherwise overlays the copy button on headerless plaintext.
// An empty title enables its structural header; once that header becomes
// a collapse button, give plaintext the same localized code label that
Expand Down
27 changes: 27 additions & 0 deletions packages/ui/stories/markdown.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,33 @@ export const TranscriptTurn: Story = {
),
};

// Real path: chat → an assistant turn containing source code. The wide frame
// keeps the desktop chat measure, rather than the Storybook viewport, as the
// visible limit so code-line regressions are easy to compare.
export const TranscriptCodeBlock: Story = {
render: () => (
<ProseFrame width={1040}>
<div className="maka-turn">
<ChatMessageBubble variant="ghost" className="maka-chat-message-bubble maka-chat-message-bubble-assistant">
<Markdown
density="compact"
text={[
'## Runtime connection',
'',
'The desktop keeps the full request readable without wrapping source code into short visual fragments.',
'',
'```ts',
'const connection = await runtimeHost.connect({ workspaceRoot, expectedRootId, initialConnectionTimeoutMs: 45_000 });',
'await connection.send({ type: \'session.message\', sessionId, content, attachments });',
'```',
].join('\n')}
/>
</ChatMessageBubble>
</div>
</ProseFrame>
),
};

// Real path: 每日回顾 → a generated report that mixes headings, emphasis, a list,
// a quote and a table. This is the document density — the Daily Review panel is
// the caller that leaves `density` unset. (It was annotated as a chat answer,
Expand Down