Skip to content

feat: group by caller namespace across data-table views#759

Merged
lcottercertinia merged 6 commits into
certinia:mainfrom
lukecotter:feat-group-by-caller-namespace
May 12, 2026
Merged

feat: group by caller namespace across data-table views#759
lcottercertinia merged 6 commits into
certinia:mainfrom
lukecotter:feat-group-by-caller-namespace

Conversation

@lukecotter
Copy link
Copy Markdown
Contributor

📝 PR Overview

Adds a Group by Caller Namespace option across the Analysis, Bottom-Up, SOQL, and DML views, so users can see at a glance which package's code is responsible for activity in other namespaces (especially useful when SOQL/DML runs in default but was triggered by a managed package).

Also aligns the Bottom-Up and Analysis toolbars to a consistent Actions → Filters → Group order, applies the Details filter on Bottom-Up (previously skipped), and fixes a Tabulator expand/collapse crash on Bottom-Up.

🛠️ Changes made

  • Add a getCallerNamespace(event) utility (log-viewer/src/core/utility/CallerNamespace.ts) that returns the namespace of an event's direct parent (memoized).
  • Add a hidden callerNamespace field on AggregatedRow, BottomUpRow, and MergedCalltreeRow so it's available for grouping without taking up a visible column.
  • Add Caller Namespace to the group-by dropdown on Analysis, Bottom-Up, SOQL, and DML; route the label to the callerNamespace field.
  • Reorder Analysis and Bottom-Up toolbars to Actions → Filters → Group for consistency.
  • Apply the Details filter on Bottom-Up too (was Time Order / Aggregated only).
  • Extract expandCollapseAll into a shared util (features/call-tree/utils/ExpandCollapse.ts) that gates recursion on row.getTreeChildren().length — tolerates uninitialised rows under Tabulator's virtualisation rather than crashing in DataTree.expandRow.
  • Extract makeShowDetailsFilter into a shared util (features/call-tree/utils/DetailsFilter.ts).
  • Hover tooltip on the raw-log "Show in Log Analysis" link now reads Reveal event in timeline instead of the raw command: URI.

🧩 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

🔗 Related Issues

resolves #604

✅ Tests added?

  • 👍 yes

Added CallerNamespace.test.ts covering strict-direct-parent semantics and memoisation. Existing Aggregation and call-tree tests cover the new callerNamespace field path. 846/846 pass.

📚 Docs updated?

  • 🔖 README.md
  • 🔖 CHANGELOG.md
  • 📖 help site

Anything else we need to know?

The Bottom-Up Expand/Collapse fix uses getTreeChildren().length > 0 as a guard rather than calling treeExpand blindly. This is a workaround for an upstream Tabulator inconsistency: DataTree.expandRow/collapseRow/toggleRow access row.modules.dataTree.children without guarding config, while the sibling getTreeChildren does guard. Under virtualisation (Tabulator's default), off-screen rows never get row-init, so modules.dataTree is undefined and expandRow throws. Proper upstream fix would be lazy-initialisation inside those three methods. Tracked in our tabulator_known_bugs.md memory note.

Extend the caller-namespace grouping (added on DML/SOQL) to the
Analysis and Bottom-Up views and align their toolbars.

- Add `callerNamespace` to AggregatedRow, BottomUpRow, and
  MergedCalltreeRow so it's available as a hidden grouping field
  (no visible column).
- Add "Caller Namespace" to the group-by dropdown on Analysis and
  Bottom-Up; route the label to the `callerNamespace` field.
- Reorder both toolbars to Actions → Filters → Group for consistency.
- Apply the Details filter on Bottom-Up too (previously skipped).
- Extract `expandCollapseAll` (gated on `getTreeChildren().length` so
  it tolerates uninitialised rows under virtualisation) and
  `makeShowDetailsFilter` into shared utilities; consume them from
  CalltreeView and AnalysisView.
@lcottercertinia lcottercertinia merged commit 9012372 into certinia:main May 12, 2026
5 checks passed
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: view, filter and group dml by caller namespace

2 participants