Skip to content

feat(call-tree): apply theme colours to Name column#782

Open
FishOfPrey wants to merge 2 commits into
certinia:mainfrom
FishOfPrey:feat-call-tree-theme-coloring
Open

feat(call-tree): apply theme colours to Name column#782
FishOfPrey wants to merge 2 commits into
certinia:mainfrom
FishOfPrey:feat-call-tree-theme-coloring

Conversation

@FishOfPrey
Copy link
Copy Markdown

📝 PR Overview

Colours the Name cell in all three Call Tree views (Time Order, Aggregated, Bottom-Up) using the same category colours as the flame graph, consistent with the active timeline theme.

Each row gets a CSS class derived from its event category (e.g. row-cat-dml). CSS custom properties set on the host element map those classes to the current theme colours, so switching themes updates all rows instantly without a table redraw.

🛠️ Changes made

CalltreeView.ts

  • Added connectedCallback that reads the active theme from settings on load and listens for switchTimelineTheme messages to stay in sync with the timeline
  • Added _applyTheme which sets 8 CSS custom properties (--ct-color-apex, --ct-color-dml, etc.) on the host element using getTheme()
  • Added _rowFormatter which stamps a category CSS class (e.g. row-cat-dml) onto each Tabulator row based on originalData.category
  • Added CSS rules that use those classes + CSS custom properties to apply a subtle background tint and matching text colour to the Name cell (.datagrid-code-text) in each row
  • Passes _rowFormatter to all three table creation calls (Time Order, Aggregated, Bottom-Up)

TableShared.ts

  • Added optional rowFormatter callback to the TableCallbacks interface

TimeOrderTable.ts, AggregatedTable.ts, BottomUpTable.ts

  • Each passes callbacks.rowFormatter through to the Tabulator options

Design notes

  • Theme changes update all rows instantly via CSS custom properties — no table redraw needed
  • Category CSS classes are derived programmatically (category.toLowerCase().replace(' ', '-')) so no lookup table or lint suppression is required
  • Only the Name cell is coloured, leaving numeric columns unaffected

🧩 Type of change (check all applicable)

  • 🐛 Bug fix - something not working as expected
  • ✨ New feature – adds new functionality
  • ♻️ Refactor - internal changes with no user impact
  • ⚡ Performance Improvement
  • 📝 Documentation - README or documentation site changes
  • 🔧 Chore - dev tooling, CI, config
  • 💥 Breaking change

📷 Screenshots / gifs / video [optional]

Screenshot 2026-05-25 102035

🔗 Related Issues

Closes #734

✅ Tests added?

  • 👍 yes
  • 🙅 no, not needed
  • 🙋 no, I need help

📚 Docs updated?

  • 🔖 README.md
  • 🔖 CHANGELOG.md
  • 📖 help site
  • 🙅 not needed

Anything else we need to know? [optional]

Daniel Ballinger and others added 2 commits May 25, 2026 07:45
Colours the Name cell in all three Call Tree views (Time Order,
Aggregated, Bottom-Up) using the same category colours as the flame
graph, consistent with the active timeline theme.

Each row gets a CSS class derived from its event category
(e.g. `row-cat-dml`). CSS custom properties set on the host element
map those classes to the current theme colours, so switching themes
updates all rows instantly without a table redraw.

Closes certinia#734

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ting

Replaces the full background+text colouring with a 6px coloured
border-left chip on the Name column by default.

Adds a `lana.callTree.categoryColourise` boolean VS Code setting
(default false). When enabled, the full background tint and text colour
are applied via a `.category-colourise` host class, matching the
reviewer's request for opt-in full colouring.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@FishOfPrey
Copy link
Copy Markdown
Author

@lcottercertinia I've updated the PR as requested to make the default colouring more subtle with a chip/border to the left of each row. There is also a setting to enable the more colourful option if desired. 🌈 😃

Subtle Mode

Screenshot 2026-05-26 073855

Extension Setting

Screenshot 2026-05-26 073813

Rainbow Mode

Screenshot 2026-05-26 073737

@FishOfPrey
Copy link
Copy Markdown
Author

I did toy with having another CallTreeView checkbox up next to Details and Debug Only, but it started to get a bit overwhelming in terms of upfront control options. This seemed like something someone would toggle once in the extension settings and then leave in place.

Although the one nice thing that did happen when I had it via the checkbox was it would refresh the view every time the checkbox was changed. I didn't need to close and reopen the log to reflect the changes.

I didn't add the colour key for each category to the CallTreeView either. It would take up more space, but would provide ques as to what the colours are showing.
Screenshot 2026-05-26 075314

@FishOfPrey
Copy link
Copy Markdown
Author

FishOfPrey commented May 25, 2026

Another experiment was to try and match the flame graph colouring. But that seemed like a bit too much in a table column.

Screenshot 2026-05-26 081614

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.

✨ feat: Theme coloring support for the Call Tree

1 participant