feat(replay-vision): add observation detail pages per sacnner type#60217
Merged
Conversation
f4689a8 to
c070738
Compare
Contributor
|
🎭 Playwright didn't run on this PR — your changes touch code that could affect E2E behavior, but Playwright is opt-in via label now to keep CI cost down. Add the Most PRs don't need this. Real regressions still get caught on master and fix-forward. |
Contributor
|
Size Change: +24.2 kB (+0.03%) Total Size: 80.2 MB 📦 View Changed
ℹ️ View Unchanged
|
Contributor
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
products/replay_vision/frontend/observations/ReplayObservation.tsx:34-37
`readResult` is defined identically in both `ObservationCard.tsx` (line 35) and here. The one in `ObservationCard.tsx` should be exported and imported here to satisfy OnceAndOnlyOnce — a private helper with the exact same signature living in two files is the clearest DRY violation in this PR. The same duplication exists for the config-extraction pattern: `readConfig` in `ObservationCard.tsx` vs. the inline `snapshotConfig` ternary on lines 530–532 here.
```suggestion
// readResult is exported from ObservationCard.tsx — import it from there instead of re-declaring here.
```
### Issue 2 of 2
products/replay_vision/frontend/components/ObservationCard.tsx:40-41
A module-level regex with the `g`/`gi` flag is stateful: `exec` advances `lastIndex` on every match, and that state is shared by every call to `CitedText`. The manual `EVENT_ID_PATTERN.lastIndex = 0` reset at line 126 guards against stale state, but the safety depends on that single line never being removed. Creating the regex inside `CitedText` (no module-level constant) makes the guard unnecessary and the code resilient to future edits.
```suggestion
// Matches `(event_id <16-hex>)` markers the model emits inline; mirrors the backend's `_EVENT_ID_CITATION_RE`.
// Created inside CitedText rather than at module scope to avoid shared `lastIndex` state between renders.
function makeEventIdPattern(): RegExp {
return /\(event_id ([0-9a-f]{16})\)/gi
}
```
Reviews (1): Last reviewed commit: "feat(replay-vision): add observation det..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Instead of expandable list on the table, a dedicated details page per scan is nicer to have.
Changes
/replay-vision/observations/:idthat cointains title, Result, Reasoning panel, embedded recording, ScenePanel metadataObservationCard.tsxinto focused renderers (primary, secondary, confidence, dock card, list cell)CitedTextparses (event_id ) in model output, renders as clickable timestamp links into the recordingHow did you test this code?
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Publish to changelog?
no
Docs update
skip-inkeep-docs🤖 Agent context