wire up status buttons, fix UI lag, and resolve Radix warnings#148
Merged
ionfwsrijan merged 1 commit intoJun 21, 2026
Merged
Conversation
Contributor
Author
|
hello @ionfwsrijan Please review it and let me knowif any change required. thanks! |
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.
Linked issue
Closes #139
What this PR does
This PR resolves the issue where the "Accept Risk" and "Ignore Finding" buttons were permanently disabled. It builds the complete end-to-end flow by introducing a new
PATCH /findings/{id}/statusbackend endpoint and wiring the frontend UI to interact with it. It introduces loading states, toggle logic (e.g., clicking "Accepted" reverts it to "Open"), and instantly updates the local React state without requiring a page reload.Additionally, this PR addresses two major performance/stability bugs discovered during implementation:
shadcn/ui<SheetDescription>component to completely silence strict accessibility console warnings.Type of change
ML tier (if applicable)
Stack affected
Changes
Backend
backend/app/main.py: Added thePATCH /findings/{finding_id}/statusroute with error handling and validation. Includes a failsafe auto-migration block to append thestatuscolumn to existing SQLite databases if missing.backend/app/models.py: Added theFindingStatusUpdatePydantic model to validate the incoming JSON payload.Frontend
frontend/src/app/lib/api.ts: Added theupdateFindingStatusAPI client function.frontend/src/app/pages/findings.tsx:onClickhandlers, loading spinners, and state-reversion logic..slice(0, 150)to thefilteredFindings.maploops to massively improve rendering performance on large datasets.<SheetDescription>to satisfy Radix UI accessibility requirements and clear theMissing 'Description'andFunction components cannot be given refsconsole errors.New dependencies
Database / schema changes
findingstable now utilizes astatuscolumn. A safeALTER TABLEexecution block was added to the PATCH route to dynamically migrate older local SQLite databases without crashing.Testing
How did you test this?
Tested locally end-to-end. Uploaded a mock repository to generate a large dataset of findings. Verified that clicking the status buttons correctly triggers the PATCH request without
422 Unprocessable Entityerrors, instantly updates the UI state (turning badges green/gray), and handles reverting back to "Open". Verified that the browser no longer lags when updating state, and confirmed the Chrome Developer Console is completely free of Radix UI accessibility warnings.Checklist
console.erroror unhandled Python exceptions introducedrequirements.txt/package.jsonupdated if new dependencies added.pkl,.pt, etc.) are gitignored, not committedAnything reviewers should focus on
Pay attention to the
.slice(0, 150)addition infindings.tsx. This acts as a lightweight virtualization to prevent the DOM from choking on 1,700+ rows. The search and filter functions still evaluate the entire array in memory, so functionality is untouched, but the DOM payload is significantly reduced.Screenshots (if UI changed)
(Status buttons now feature dynamic colors, loading spinners, and text toggles when clicked. Console is clean.)