Skip to content

Add two-stage trace filtering#76

Open
100more wants to merge 1 commit into
tsperf:mainfrom
100more:two-stage-trace-filtering
Open

Add two-stage trace filtering#76
100more wants to merge 1 commit into
tsperf:mainfrom
100more:two-stage-trace-filtering

Conversation

@100more
Copy link
Copy Markdown

@100more 100more commented May 20, 2026

Add two-stage trace filtering

Summary

  • add shared child-filter helpers for trace-name and path-exclude matching
  • apply path exclusions to start-node searches and expanded child fetches
  • add webview controls for child trace-name filtering and common path-exclude presets
  • keep filter message parsing backward-compatible with defaults for older payloads

Addresses #41.

Why this is low-risk

  • keeps the existing top-level Trace Name, Source File, Position, and Sort controls intact
  • does not change trace parsing or persisted trace storage
  • new message fields are optional defaults, so existing filterTree messages remain valid

Files changed

  • src/treeFilters.ts - added: shared helpers for filter lists, path exclusions, and visible child branches
  • src/traceTree.ts - modified: filters expanded child nodes with active webview child/path filters
  • shared/src/messages.ts - modified: adds defaulted filterTree child/path fields
  • src/handleMessages.ts - modified: passes new filterTree fields to trace tree rendering
  • ui/app.vue - modified: adds child trace and path preset filter controls
  • test/index.test.ts - modified: covers filter-list parsing, path exclusion, and child-branch matching

Coverage

  • multiline and comma-separated path exclude parsing
  • case-insensitive path exclusion matching
  • ancestor preservation when a descendant child trace matches
  • combined child trace-name filtering and path exclusion

Verification

  • pnpm exec vitest run test/index.test.ts - passed
  • pnpm run typecheck - passed
  • pnpm exec eslint src/treeFilters.ts src/traceTree.ts src/handleMessages.ts shared/src/messages.ts ui/app.vue test/index.test.ts - passed
  • pnpm lint - passed
  • pnpm build - passed
  • git diff --check - passed
  • CI=1 pnpm test - passed

Reviewer notes

  • This is intended as a scoped first step for better filtering #41: start-node search stays broad, while expanded children can be constrained by trace name and path predicates.
  • Narrowing the start-node search itself is intentionally left out of scope for this PR; it would be a follow-up once the desired top-level query semantics are agreed.
  • Path presets only populate the existing exclude field; users can edit the resulting newline-separated list before filtering.

Boundary note

No payment, account, secret, or private contact details are included in this PR.

@100more 100more requested a review from danielroe as a code owner May 20, 2026 14:42
@100more
Copy link
Copy Markdown
Author

100more commented May 21, 2026

Confirmed the full CI-style test command locally after this scope clarification:

  • CI=1 pnpm test - passed

The command ran the pretest build/lint chain and then Vitest completed test/index.test.ts with 5 tests 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.

1 participant