Skip to content

refactor(web): unify log naming conventions and optimize log list data structure - #930

Merged
kyasbal merged 4 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-rurkzqrwumwm
Sep 1, 2026
Merged

kyasbal merged 4 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-rurkzqrwumwm

Conversation

@kyasbal

@kyasbal kyasbal commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

This PR addresses two main areas in the web frontend:

  1. Log Naming Conventions Unification:

    • Renamed activeLogIds to filteredLogIds across WebGL timeline renderers and chart components for consistency with CEL filter terminology.
    • Renamed allLogsWithoutFilter and related caches to allLogs and allLogsHistogramCache.
    • Renamed highlightLogIndices to highlightedLogIndices across selection manager, components, and templates to follow standard past-participle adjective naming for state.
    • Renamed shownLogs / shownLogIds to visibleLogIds and visibleLogsCount in LogListComponent to align with visibleTimelines semantics.
  2. Log List Memory & Performance Optimization:

    • Replaced input of full allLogs: Log[] object array in LogListComponent with domain logStore: LogStore.
    • Changed filtered logs resolution in LogListComponent to compute visibleLogIds: number[] (raw numeric IDs) instead of instantiating an entire Log[] adapter array.
    • Instantiates Log adapters on-demand per rendered row inside the CDK Virtual Scroll viewport via store.getLog(logId).
    • Removed expensive allLogs computed signal from LogSmartComponent.

Verification

  • make pre-commit: PASSED
  • make test-web: PASSED (1088/1088 tests passing)
  • make build-storybook: PASSED
- Rename activeLogIds to filteredLogIds in WebGL renderer and timeline-chart component
- Rename highlightLogIndices to highlightedLogIndices in selection manager, timeline, log, and diff components
- Rename allLogsWithoutFilter to allLogs in timeline-frame and timeline-smart components
- Update JSDoc descriptions and unit tests/stories accordingly
…e resolution

- Change LogListComponent input from allLogs (Log[]) to logStore (LogStore)
- Compute shownLogIds (number[]) instead of creating a full Log[] array
- Resolve Log adapters on-demand per virtual-scroll row using store.getLog(logId)
- Remove expensive allLogs signal from LogSmartComponent
- Update unit tests and Storybook stories accordingly
- Rename shownLogIds to visibleLogIds
- Rename shownLogsCount to visibleLogsCount
- Align naming with visibleTimelines across the web UI

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the frontend log handling by introducing a centralized LogStore input and renaming several properties (such as highlightLogIndices to highlightedLogIndices and activeLogIds to filteredLogIds) for better consistency. Feedback on these changes highlights a potential performance issue in LogListComponent where retrieving logs dynamically within the virtual scroll loop creates new object instances on every change detection cycle, and suggests caching them. Additionally, it is recommended to refactor the invalidate signal in TimelineChartComponent to a plain boolean property to avoid writing to signals inside effects.

@kyasbal
kyasbal merged commit fdd2d41 into GoogleCloudPlatform:main Sep 1, 2026
16 checks passed
@kyasbal
kyasbal deleted the push-rurkzqrwumwm branch September 1, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant