Skip to content
This repository was archived by the owner on Sep 28, 2025. It is now read-only.

Fix table rendering in markdown with improved glamour styling#19

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-18
Draft

Fix table rendering in markdown with improved glamour styling#19
Copilot wants to merge 3 commits intomainfrom
copilot/fix-18

Conversation

Copy link
Contributor

Copilot AI commented Aug 17, 2025

The table rendering in assistant messages was poorly formatted with misaligned columns and overlapping content. As shown in the issue screenshot, tables appeared with broken alignment, content wrapping incorrectly within cells, and poor visual hierarchy.

Problem:
The glamour StyleTable configuration was minimal, lacking proper margin, indentation, and color settings. This resulted in:

  • Poor column alignment
  • Content overlapping with table borders
  • Inconsistent spacing
  • Difficult to read table structure

Solution:
Enhanced the table styling configuration in internal/tui/styles/markdown.go by adding:

Table: ansi.StyleTable{
    StyleBlock: ansi.StyleBlock{
        StylePrimitive: ansi.StylePrimitive{
            BlockPrefix: "\n",
            BlockSuffix: "\n",
            Color:       stringPtr(adaptiveColorToString(t.MarkdownText())),
        },
        Margin: uintPtr(defaultMargin),      // Added proper spacing
        Indent: uintPtr(1),                  // Added indentation for hierarchy
    },
    CenterSeparator: stringPtr("┼"),
    ColumnSeparator: stringPtr("│"),
    RowSeparator:    stringPtr("─"),
},

Results:

  • Tables are now properly indented with consistent spacing
  • Column content is better organized and aligned
  • Text flows more naturally within cells
  • Improved visual hierarchy and readability
  • Consistent theming with the rest of the application

Testing:
Added comprehensive tests to validate the table rendering improvements and ensure no regressions in existing functionality.

Fixes #18.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits August 17, 2025 14:00
Co-authored-by: yyovil <149292478+yyovil@users.noreply.github.com>
Co-authored-by: yyovil <149292478+yyovil@users.noreply.github.com>
Copilot AI changed the title [WIP] fix tables while rendering assistant message Fix table rendering in markdown with improved glamour styling Aug 17, 2025
Copilot AI requested a review from yyovil August 17, 2025 14:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix tables while rendering assistant message

2 participants