Skip to content

feat(web): improve static timeline export clarity, leader routing, and inspection caching - #1317

Open
kyasbal wants to merge 1 commit into
push-yyqtuxrlvmvtfrom
push-yowxrnppozmk
Open

kyasbal wants to merge 1 commit into
push-yyqtuxrlvmvtfrom
push-yowxrnppozmk

Conversation

@kyasbal

@kyasbal kyasbal commented Dec 1, 2026

Copy link
Copy Markdown
Member

Summary

Part 4/5 of the render_timelines visual clarity, evidence manifest, and khi-investigation skill stack.

  • Improves static /render/mcp-timeline visual legibility: refines callout/connector leader routing, single-row 4-column evidence deck layout, ruler tick readability, role badge width reservation, bottom frame clearance, and index pane truncation/sizing.
  • Adds an LRU cache (capacity = 4) for parsed InspectionData instances and cached log slices in McpTimelineRenderSmartComponent so interleaved renders across multiple loaded inspections avoid cold reloads.
  • Updates Angular unit tests across pages/timeline-render/* and timeline/components/*.

Stack

  1. fix(workbench): exempt KHI synthetic IDs, globs, and K8s refs in validate_report (main <- push-qylzxxkzxpry)
  2. feat(mcp): unify annotation string IDs, fix subtree highlights, and emit resolved evidence manifest (push-qylzxxkzxpry <- push-zxtpyqnnnxrr)
  3. fix(mcp): harden Chrome timeline renderer timeouts, pixel cap, and warm session reuse (push-zxtpyqnnnxrr <- push-yyqtuxrlvmvt)
  4. This PR: feat(web): improve static timeline export clarity, leader routing, and inspection caching (push-yyqtuxrlvmvt <- push-yowxrnppozmk)
  5. feat(skills): guide visual-first two-layer reporting in khi-investigation skill #1313: feat(skills): guide visual-first two-layer reporting in khi-investigation skill (push-yowxrnppozmk <- push-nywmlvytopkk)

Verification

  • make qa-fast-must QA_LANG=ts — PASS (0 mustfix, 0 advisory, 0 skipped)
  • make lint-web (ng lint, lint:style, lint:unused) — PASS
  • make check-format-web — PASS
  • make build-web & Angular Karma unit tests (1676/1676) — PASS

@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 introduces a static export mode to suppress interactive elements and clamp ruler labels for headless PNG capture, implements an LRU cache for inspection data to optimize switching between inspections, and enhances layout algorithms to prevent visual collisions (such as staggering co-located pins and routing tethers through gutters). Additionally, it optimizes log histogram rendering by reusing the full-archive histogram when filters match all logs. The review feedback correctly identifies a potential runtime error in resolveSessionId() where window is accessed directly without a defensive check, which could fail in SSR or server-side test environments.

Comment on lines +498 to 501
private resolveSessionId(): string {
const sessionMatch = window.location.pathname.match(/\/session\/([^/]+)/);
return sessionMatch ? sessionMatch[1] : '0';
}

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.

high

Directly referencing window without checking if it is defined can cause runtime errors (such as ReferenceError: window is not defined) during Server-Side Rendering (SSR), prerendering, or in server-side test environments. We should restore the defensive check typeof window !== 'undefined' that was present in the previous implementation.

  private resolveSessionId(): string {
    const sessionMatch =
      typeof window !== 'undefined'
        ? window.location.pathname.match(/\/session\/([^/]+)/)
        : null;
    return sessionMatch ? sessionMatch[1] : '0';
  }
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Code Quality Report — ✅ Cloud Build success

Cloud Build completed without an embedded report envelope.


Commit: ed9618ecfe26 · Cloud Build Logs

@kyasbal
kyasbal added this pull request to stack #1322 December 1, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant