Repository navigation
Conversation
… timeline renders The static /render/timeline page used a fixed 300px index pane, so long resource names were truncated with an ellipsis, and it showed the collapse toggle and context menu buttons that cannot be used in a screenshot. - Size the index pane to fit the longest rendered label, estimated with canvas text measurement, between 300px and half of the render width. - Add showIndexControls and indexPaneWidth inputs to the timeline frame, and a showControls input to the timeline index. - Hide the collapse toggle and context menu buttons in static renders. Refs GoogleCloudPlatform#1193 (item 4)
There was a problem hiding this comment.
Code Review
This pull request introduces dynamic width calculation for the timeline index pane based on the longest rendered label, and adds a showIndexControls option to hide interactive controls in static renders. The feedback suggests adding safety guards for non-browser environments (such as SSR or Node-based tests) when accessing global browser APIs like document and window.getComputedStyle to prevent potential runtime errors.
…rm#1231 Index pane auto-fit is already implemented in the timeline scene stack (GoogleCloudPlatform#1231), so keep this change focused on hiding the interactive-only collapse toggle and context menu buttons in static renders.
|
I noticed #1231 already auto-fits the index pane width, so I removed that part to avoid duplicating it. This PR now only hides the collapse toggle and context menu buttons on |
Part of #1193 (item 4)
Summary
The static
/render/timelinepage showed the collapse toggle (chevron) and context menu (more_vert) buttons in every index row. They cannot be used in a static screenshot and take up horizontal space in the index pane.This change:
showControlsinput toTimelineIndexComponentthat hides the collapse toggle and context menu buttons when false.showIndexControlsinput toTimelineFrameComponentand passes it to both the scrolling and sticky index panes. It defaults totrue, so the main inspector is unchanged.showIndexControlstofalseon/render/timeline.Index pane auto-fit (the other half of item 4) is already covered by the timeline scene stack in #1231, so it is not included here.
Testing
timeline-frame.component.spec.tscase checking that menu buttons are hidden whenshowIndexControlsis false./render/timelinewith a synthetic audit log: 21 menu buttons and 15 collapse toggles before, 0 after.