Implement the following plan: Fix: "Evaluate Impact" button not visible on Remediation…
- User
Implement the following plan:
Fix: "Evaluate Impact" button not visible on Remediation History
Context
The "Evaluate Impact" button on remediation history cards is fully implemented but hidden because
hasRepoUrlevaluates tofalse. The check readsrepositoryUrlfromevaluationData.metadata.repositoryUrl(the result JSON), but this field is null in the database for this evaluation. Meanwhile, the DBrepository_urlcolumn correctly stores the URL (https://github.com/jayvicsanantonio/ai-timeline-automation).Root cause:
RemediateTabderiveshasRepoUrlfromevaluationData.metadata.repositoryUrl, but:- The
result_json.metadatamay not containrepositoryUrlfor evaluations run before the git metadata feature was added currentRepositoryUrl(which correctly reads from the DB column) is available inApp.tsxbut never passed toRemediateTab
Fix
Pass
currentRepositoryUrlfromApp.tsxdown toRemediateTab→RemediationHistoryinstead of deriving it from result metadata.Files to modify
-
frontend/src/components/RemediateTab.tsx- Add
repositoryUrl?: string | nulltoRemediateTabProps(line 41-49) - Replace the
hasRepoUrlinline computation (lines 541-552) with a simple check on the new prop:codehasRepoUrl={!!repositoryUrl && repositoryUrl !== "unknown" && (repositoryUrl.startsWith("http") || repositoryUrl.startsWith("git@"))}
- Add
-
frontend/src/App.tsx- Add
repositoryUrl={currentRepositoryUrl}to the<RemediateTab>usage (line 2017-2025)
- Add
Verification
bun run test— all tests passbun run lint— no lint errors- Manual: load evaluation
dd283666-3a94-43cd-8565-7dff030c01d1, go to Remediate tab, confirm "Evaluate Impact" button is visible on remediation history cards
- The
Assistant
Now let me see the full
hasRepoUrlcomputation and theRemediationHistorycomponent call.Assistant
Now I have all the context. Let me make the three edits.
Assistant
Now update
App.tsxto pass the prop.Assistant
Now let me run tests and lint.
Assistant
All 1274 tests pass. Now lint.
Assistant
Formatting issue. Let me fix it.
Assistant
All done. Here's a summary of the changes:
frontend/src/components/RemediateTab.tsx:- Added
repositoryUrl?: string | nulltoRemediateTabProps - Destructured
repositoryUrlin the component function - Replaced the IIFE that read from
evaluationData.metadata.repositoryUrl(which could be null in the result JSON) with a direct check on the newrepositoryUrlprop
frontend/src/App.tsx:- Passed
repositoryUrl={currentRepositoryUrl}to<RemediateTab>, using the value that comes from the DBrepository_urlcolumn (which is always populated)
Tests: 1274 pass, 0 fail. Lint: clean.
- Added
- User
commit
Assistant
I see there are additional changes in the diff beyond my fix (Packmind artifact refactoring in
RemediateTab.tsxandRemediationHistoryCard.tsx). These were already modified before this session. I'll commit only the two files I changed for this task.Assistant
The staged changes include the Packmind refactoring that was already in
RemediateTab.tsxbefore my edit. Let me check what's actually staged vs what I changed.Assistant
The
RemediateTab.tsxchanges include both my fix and the pre-existing Packmind artifact changes. Since these were already in the working tree, I'll include them all in one commit.Assistant
Committed as
9f025fd— pre-commit hooks passed (tests, lint, typecheck all green).