Skip to content

Commit d2fee8e

Browse files
committed
web: honor filtered path index in timing detail overlay
Use _originalIndex in _selectDetailRow so pin overlay requests match the backend when paths are narrowed by histogram slack filter. Also fuse the filter map+filter into a single pass to avoid allocating a clone for every path in the unfiltered report. Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
1 parent 89d6f86 commit d2fee8e

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/web/src/timing-widget.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,12 @@ export class TimingWidget {
298298
const paths = this._currentTab === 'setup' ? this._setupPaths : this._holdPaths;
299299
const path = paths[this._selectedPathIndex];
300300
const nodes = this._detailTab === 'data' ? path.data_nodes : path.capture_nodes;
301+
// Use _originalIndex when paths were filtered (e.g. by histogram
302+
// column click in static mode) so the overlay lookup matches.
303+
const highlightIdx = path._originalIndex ?? this._selectedPathIndex;
301304
this._app.websocketManager.request({
302305
type: 'timing_highlight',
303-
path_index: this._selectedPathIndex,
306+
path_index: highlightIdx,
304307
is_setup: this._currentTab === 'setup' ? 1 : 0,
305308
pin_name: nodes[idx].pin,
306309
}).then(() => this._redrawAllLayers());

src/web/src/websocket-manager.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,12 @@ export class WebSocketManager {
180180
if (type === 'timing_report'
181181
&& msg.slack_min != null && msg.slack_max != null
182182
&& json.paths) {
183-
const filtered = json.paths
184-
.map((p, i) => ({ ...p, _originalIndex: i }))
185-
.filter(
186-
p => p.slack >= msg.slack_min && p.slack < msg.slack_max);
183+
const filtered = [];
184+
json.paths.forEach((p, i) => {
185+
if (p.slack >= msg.slack_min && p.slack < msg.slack_max) {
186+
filtered.push({ ...p, _originalIndex: i });
187+
}
188+
});
187189
return Promise.resolve({ ...json, paths: filtered });
188190
}
189191
return Promise.resolve(json);

0 commit comments

Comments
 (0)