Skip to content

feat(tui): Add Node-Type Colour Coding to Timeline View#23

Open
JasonWarrenUK wants to merge 1 commit intoexperiment/auto-execute-roadmapfrom
feat/timeline-type-colours
Open

feat(tui): Add Node-Type Colour Coding to Timeline View#23
JasonWarrenUK wants to merge 1 commit intoexperiment/auto-execute-roadmapfrom
feat/timeline-type-colours

Conversation

@JasonWarrenUK
Copy link
Copy Markdown
Owner

Add Node-Type Colour Coding to Timeline View

Overview

Timeline entries can now display coloured type badge pills and tinted body text, giving each node type a distinct visual identity in the timeline view.

Summary

Previously the timeline was a monochrome scroll of dates and text — like reading a newspaper printed entirely in grey ink. Now each entry wears a little coloured name-tag, as if the nodes got dressed up for a conference and are mingling by the buffet table.

Tip

No action required after pulling. The TypeColour callback field on TimelineRenderer is opt-in — existing code that constructs the renderer without it continues to work unchanged.


Changes

internal/tui/badge.go — export BadgeColourFor
  • Renamed badgeColourFor to BadgeColourFor (exported) so other packages can look up type colours
  • Updated internal caller TypeBadge to use the new name
internal/tui/badge_test.go — update references
  • All test references updated from badgeColourFor to BadgeColourFor
internal/tui/views/timeline.go — type colour support
  • Added TypeColour func(typeName string) (bg, fg string) callback field
  • Added TypesColumn string field (defaults to "types")
  • Render() now extracts types from each row, renders a badge pill next to date headers, and tints body text with the first type's foreground colour
  • Added extractTypes() helper that handles []interface{}, []string, and single string values
  • Added typesColumn() helper for default column name
internal/tui/views/timeline_test.go — new tests
  • TestTimelineRenderer_TypeColouredOutputDiffersFromPlain — coloured output differs from nil-callback output
  • TestTimelineRenderer_MissingTypesColumnGraceful — no panic when types column is absent
  • TestTimelineRenderer_TypeBadgeAppearsInOutput — badge text renders in output
  • TestExtractTypes_* — five tests covering slice-of-interface, string slice, single string, missing column, and nil value

🤖 Generated with Claude Code

Export BadgeColourFor so timeline (and future views) can look up type
colours. TimelineRenderer gains TypeColour callback and TypesColumn
fields: when set, each entry shows a coloured badge pill next to the
date header and tints body text with the first type's foreground colour.

Includes extractTypes helper and tests for coloured output, graceful
degradation when the types column is missing, and badge text rendering.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant