Skip to content

[Bug] Markdown prose stops at its 680px default inside a wider chat column, so one bubble has two right edges #5598

Closed

Description

@Astro-Han

Description

Markdown caps prose at contentWidth = 680 with contentAlign: 'start', and deliberately leaves code blocks and tables to fill the container. In a container narrower than 680 that is invisible. In a wider one the two halves of the same bubble stop at different places: paragraphs, headings and lists end at 680px while the code block directly below them reaches the container edge.

The chat surface is wider than 680 by Astryx's own default path. ChatLayout at density="spacious" styles its message area max-width: 800px with padding-inline: var(--spacing-4), and ChatMessageBubble documents variant="ghost" with width="100%" for rich content, which replaces the max(80%, 280px) cap with the full column. Nothing in that composition is unusual — it is what the Chat docs recommend for Markdown answers — and no consumer chose either number.

Layout already has the mechanism this needs. It publishes its contentWidth as --layout-content-width, and LayoutHeader / LayoutFooter read it back as var(--layout-content-width, none), inert when unset. Neither Markdown nor ChatLayout participates: Markdown hardcodes 680 as a prop default, ChatLayout compiles 800 into a style with no variable, so the two cannot see each other.

Passing contentWidth="100%" at every Markdown call site works, but it asks each consumer to know that a default they never set is fighting a container width they also never set.

Reproduction

<ChatLayout density="spacious">
  <ChatMessageBubble variant="ghost" width="100%">
    <Markdown>{'A paragraph long enough to wrap.\n\n```\ncode\n```'}</Markdown>
  </ChatMessageBubble>
</ChatLayout>

The paragraph's right edge and the code block's right edge do not agree. Measured downstream in an 800px column with no inline padding, the paragraph stops 120px short; at spacious the message area's own 16px inline padding makes the gap smaller but not zero.

Astryx Version

@astryxdesign/[email protected].

Environment

Any browser and OS. Not platform dependent.


Diagnosis and draft prepared with Claude Code; reviewed and verified by the contributor before filing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions