Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions log-viewer/src/features/call-tree/components/CalltreeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { isVisible } from '../../../core/utility/Util.js';
import type { AggregatedRow, BottomUpRow } from '../utils/Aggregation.js';
import { deepFilter, makeShowDetailsFilter } from '../utils/DetailsFilter.js';
import { expandCollapseAll } from '../utils/ExpandCollapse.js';
import type { MergedCalltreeRow } from '../utils/MergeAdjacent.js';
import type { TimeOrderRow } from '../utils/TimeOrderTree.js';

import dataGridStyles from '../../../tabulator/style/DataGrid.scss';

Expand Down Expand Up @@ -111,7 +111,7 @@ export class CalltreeView extends LitElement {
rootMethod: ApexLog | null = null;

private contextMenu: ContextMenu | null = null;
private contextMenuRow: MergedCalltreeRow | null = null;
private contextMenuRow: TimeOrderRow | null = null;
private viewSwitchEpoch = 0;

get _callTreeTableWrapper(): HTMLDivElement | null {
Expand Down Expand Up @@ -653,8 +653,8 @@ export class CalltreeView extends LitElement {
this.blockClearHighlights = false;
}

_showDetailsFilter = (data: MergedCalltreeRow): boolean =>
deepFilter<MergedCalltreeRow>(
_showDetailsFilter = (data: TimeOrderRow): boolean =>
deepFilter<TimeOrderRow>(
data,
(row) => {
const { duration, isParent, discontinuity, type } = row.originalData;
Expand All @@ -671,15 +671,15 @@ export class CalltreeView extends LitElement {
_showDetailsFilterRollup = (data: AggregatedRow | BottomUpRow): boolean =>
makeShowDetailsFilter(this.showDetailsFilterCache)(data);

_debugFilter = (data: MergedCalltreeRow | AggregatedRow | BottomUpRow): boolean =>
deepFilter<MergedCalltreeRow | AggregatedRow | BottomUpRow>(
_debugFilter = (data: TimeOrderRow | AggregatedRow | BottomUpRow): boolean =>
deepFilter<TimeOrderRow | AggregatedRow | BottomUpRow>(
data,
(row) => !!(row.originalData.type && DEBUG_VALUE_TYPES.has(row.originalData.type)),
this.debugOnlyFilterCache,
);

_typeFilter = (data: MergedCalltreeRow | AggregatedRow | BottomUpRow): boolean =>
deepFilter<MergedCalltreeRow | AggregatedRow | BottomUpRow>(
_typeFilter = (data: TimeOrderRow | AggregatedRow | BottomUpRow): boolean =>
deepFilter<TimeOrderRow | AggregatedRow | BottomUpRow>(
data,
(row) => {
const type = row.originalData.type;
Expand All @@ -694,13 +694,13 @@ export class CalltreeView extends LitElement {
_namespaceFilter = (
selectedNamespaces: string[],
_namespace: string,
data: MergedCalltreeRow | AggregatedRow | BottomUpRow,
data: TimeOrderRow | AggregatedRow | BottomUpRow,
filterParams: { filterCache: Map<string, boolean> },
): boolean => {
if (selectedNamespaces.length === 0) {
return true;
}
return deepFilter<MergedCalltreeRow | AggregatedRow | BottomUpRow>(
return deepFilter<TimeOrderRow | AggregatedRow | BottomUpRow>(
data,
(row) => selectedNamespaces.includes(row.namespace || ''),
filterParams.filterCache,
Expand Down Expand Up @@ -828,7 +828,7 @@ export class CalltreeView extends LitElement {
return;
}

const rowData = row.getData() as MergedCalltreeRow;
const rowData = row.getData() as TimeOrderRow;
this.contextMenuRow = rowData;

const items: { id: string; label: string; separator?: boolean; shortcut?: string }[] = [];
Expand Down Expand Up @@ -906,7 +906,7 @@ export class CalltreeView extends LitElement {
break;
}

const rowEvent = (row.getData() as MergedCalltreeRow).originalData as LogEvent;
const rowEvent = (row.getData() as TimeOrderRow).originalData as LogEvent;
const endTime = rowEvent.exitStamp ?? rowEvent.timestamp;

if (rowEvent.timestamp === targetEvent.timestamp) {
Expand Down
4 changes: 2 additions & 2 deletions log-viewer/src/features/call-tree/components/TableShared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import { RowKeyboardNavigation } from '../../../tabulator/module/RowKeyboardNavi
import { RowNavigation } from '../../../tabulator/module/RowNavigation.js';
import { ScrollAnchor } from '../../../tabulator/module/ScrollAnchor.js';
import type { AggregatedRow, BottomUpRow } from '../utils/Aggregation.js';
import type { MergedCalltreeRow } from '../utils/MergeAdjacent.js';
import type { TimeOrderRow } from '../utils/TimeOrderTree.js';

export interface TableCallbacks {
namespaceFilter: (
selectedNamespaces: string[],
namespace: string,
data: MergedCalltreeRow | AggregatedRow | BottomUpRow,
data: TimeOrderRow | AggregatedRow | BottomUpRow,
filterParams: { filterCache: Map<string, boolean> },
) => boolean;
onFilterCacheClear: () => void;
Expand Down
10 changes: 5 additions & 5 deletions log-viewer/src/features/call-tree/components/TimeOrderTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { minMaxTreeFilter } from '../../../tabulator/filters/MinMax.js';
import { progressFormatter } from '../../../tabulator/format/Progress.js';
import { progressFormatterMS } from '../../../tabulator/format/ProgressMS.js';
import { makeSumSelfTimeAllVisible } from '../utils/BottomCalcs.js';
import { toUnmergedCallTree, type MergedCalltreeRow } from '../utils/MergeAdjacent.js';
import { toTimeOrderTree, type TimeOrderRow } from '../utils/TimeOrderTree.js';
import { createCalltreeNameFormatter } from './CalltreeNameFormatter.js';
import {
commonColumnDefaults,
Expand All @@ -21,7 +21,7 @@ import {
} from './TableShared.js';

export interface TimeOrderCallbacks extends TableCallbacks {
showDetailsFilter: (data: MergedCalltreeRow) => boolean;
showDetailsFilter: (data: TimeOrderRow) => boolean;
onContextMenu: (e: UIEvent, row: RowComponent) => void;
}

Expand All @@ -39,7 +39,7 @@ export function createTimeOrderTable(
const excludedTypes = new Set<LogEventType>(['SOQL_EXECUTE_BEGIN', 'DML_BEGIN']);
const governorLimits = rootMethod.governorLimits;

const tableData = toUnmergedCallTree(rootMethod.children);
const tableData = toTimeOrderTree(rootMethod.children);
const nameFormatter = createCalltreeNameFormatter(excludedTypes);

const tableRef: { current: Tabulator | undefined } = { current: undefined };
Expand Down Expand Up @@ -83,7 +83,7 @@ export function createTimeOrderTable(
if (!(e.target as HTMLElement).matches('a')) {
return;
}
const node = (cell.getData() as MergedCalltreeRow).originalData;
const node = (cell.getData() as TimeOrderRow).originalData;
if (node.hasValidSymbols) {
vscodeMessenger.send<string>('openType', node.text);
}
Expand Down Expand Up @@ -278,7 +278,7 @@ export function createTimeOrderTable(
tableRef.current = table;

// Filter caches are cleared once per render via `renderStarted`. Row ids
// produced by `toUnmergedCallTree` are globally unique within a build
// produced by `toTimeOrderTree` are globally unique within a build
// (per-build monotonic counter), so cached `deepFilter` results stay valid
// across the cascaded `filter.filter()` passes Tabulator runs for each
// expanded subtree β€” `getChildren` β†’ `filter.filter(config.children)`
Expand Down
4 changes: 2 additions & 2 deletions log-viewer/src/features/call-tree/utils/BottomCalcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import type { RowComponent, Tabulator } from 'tabulator-tables';

import type { AggregatedRow, BottomUpRow } from './Aggregation.js';
import { type MergedCalltreeRow } from './MergeAdjacent.js';
import { type TimeOrderRow } from './TimeOrderTree.js';

type CalltreeRowUnion = MergedCalltreeRow | AggregatedRow | BottomUpRow;
type CalltreeRowUnion = TimeOrderRow | AggregatedRow | BottomUpRow;

interface InternalRow {
getComponent(): RowComponent;
Expand Down
229 changes: 0 additions & 229 deletions log-viewer/src/features/call-tree/utils/MergeAdjacent.ts

This file was deleted.

Loading
Loading