mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-22 00:02:38 +00:00
* fix(frontend): restore heading sizes in note markdown and keep group notes on id change Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0182GroR5mvi9ksRTMmBT7nE * fix(frontend): scope the note cleanup deferral per note Address local review nits: the header comment overstated the heading ramp (h3 sits at body size in the xs and sm scales), and the mid-update deferral bailed out of cleanup for every group note rather than the one holding the unrendered module. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0182GroR5mvi9ksRTMmBT7nE * perf(frontend): traverse modules without collecting a discarded array Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0182GroR5mvi9ksRTMmBT7nE * test(frontend): show the three markdown prose presets in the kitchen sink The Markdown tab rendered only the default preset, so a change to the shared heading scale could not be compared across the surfaces that use it. The chat sample gains headings for the same reason: it is the only place the assistant bubble renders at panel width without an AI provider. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0182GroR5mvi9ksRTMmBT7nE * refactor(frontend): validate group notes against the flow, not the render A group note's members are module ids, so the flow's own module list decides whether one still exists. Validating against the rendered nodes instead needed a special case for collapsed groups, and still dropped a live module in the pass after its id changed. Both cases are the same mistake, and checking the source of truth removes them together with the collapsedModuleIds parameter. Path completion keeps working off the rendered graph, since it needs the edges, and now skips a note whose members it cannot all see rather than dropping them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0182GroR5mvi9ksRTMmBT7nE * fix(frontend): name a new note "Note", not after its internal type The prefill lands inside the user's own note, and "Free note" / "Group note" are the serialized type, not words anyone says about a note they just drew. The menus that create them already say "Add note". The heading goes to h2 as well: h3 computes to the body size in the note scale, so the prefill's own title did not read as one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0182GroR5mvi9ksRTMmBT7nE * docs(frontend): describe what collapsedModuleIds is still for Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0182GroR5mvi9ksRTMmBT7nE --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
41 lines
3.0 KiB
TypeScript
41 lines
3.0 KiB
TypeScript
/**
|
|
* Shared prose (Tailwind typography) stacks for markdown renders, one source of
|
|
* truth so surfaces don't each roll their own and drift apart. Compose at the
|
|
* call site with layout-only classes (padding, width, bg); anything typographic
|
|
* belongs here.
|
|
*
|
|
* - 'xs': micro scale for dense secondary panes (chat reasoning blocks, group notes)
|
|
* - 'sm': compact chat-bubble scale (assistant messages, flow/app chat, settings)
|
|
* - 'doc': same rhythm and body size as 'sm', with a taller heading ramp
|
|
* (lg/base/sm) and semibold headings for document-like surfaces (artifacts)
|
|
*
|
|
* h1 and h2 step above the body size in every preset, so `#` and `##` read as
|
|
* headings rather than bold body text. Below that the tight 'xs' and 'sm' scales
|
|
* run out of room, and h3 down differentiates by weight and colour alone.
|
|
*/
|
|
|
|
// Kept as literal template parts: Tailwind's scanner reads class names verbatim
|
|
// from this file, so every token must appear as plain text.
|
|
// content-none strips the typography plugin's decorative backticks around
|
|
// inline code (code::before/::after), which read as literal ` characters.
|
|
// [&>:first-child]:mt-0 re-applies the plugin's first-block reset, which our
|
|
// explicit prose-headings:mt-* would otherwise override (note: the composed
|
|
// variant prose-headings:first: attaches :first-child to the wrapper — wrong).
|
|
const base =
|
|
'prose dark:prose-invert max-w-full break-words [&>:first-child]:mt-0 prose-a:break-words prose-code:break-words prose-code:before:content-none prose-code:after:content-none prose-code:bg-surface-secondary/50 prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-code:font-normal prose-table:block prose-table:max-w-full prose-table:overflow-x-auto'
|
|
|
|
// One vertical rhythm for sm/doc; heading margins stay per-preset (fixed, not
|
|
// the plugin's em-based ones) so 'doc' can breathe more between sections.
|
|
const rhythm = 'prose-sm leading-snug'
|
|
|
|
const bodyXs =
|
|
'text-primary prose-p:text-primary prose-li:text-primary prose-p:text-xs prose-li:text-xs prose-code:text-xs prose-pre:text-xs prose-table:text-xs'
|
|
|
|
export const markdownProse = {
|
|
xs: `${base} prose-sm leading-snug prose-p:text-2xs prose-li:text-2xs prose-code:text-2xs prose-pre:text-2xs prose-headings:font-medium prose-headings:text-secondary prose-headings:mt-2 prose-headings:mb-1 prose-h1:text-sm prose-h2:text-xs prose-h3:text-2xs prose-h4:text-2xs prose-h5:text-2xs prose-h6:text-2xs prose-strong:text-secondary`,
|
|
sm: `${base} ${rhythm} ${bodyXs} prose-headings:mt-3 prose-headings:mb-1 prose-headings:font-medium prose-headings:text-emphasis prose-h1:text-base prose-h2:text-sm prose-h3:text-xs prose-h4:text-xs prose-h5:text-xs prose-h6:text-xs`,
|
|
doc: `${base} ${rhythm} ${bodyXs} prose-headings:mt-8 prose-headings:mb-2 prose-headings:font-semibold prose-headings:text-emphasis prose-h1:text-lg prose-h2:text-base prose-h3:text-sm prose-h4:text-xs prose-h5:text-xs prose-h6:text-xs prose-pre:bg-transparent prose-pre:p-0`
|
|
} as const
|
|
|
|
export type MarkdownProseSize = keyof typeof markdownProse
|