feat(hook): UI improve disconnect error popover#9877
Conversation
|
Preview Deployment
|
Greptile SummaryThis PR improves the hook disconnect error popover by (1) surfacing up to 3 most-recent errors from the last 30 days when Key changes:
Confidence Score: 4/5Safe to merge after fixing the isBusy timing issue in handleValidate. One P1 defect: the finally block in handleValidate clears isBusy before getHook completes, creating a window where the Validate button can be clicked again mid-refresh. All other changes (ErrorLogRow extraction, Hoverable integration, getHook service function) are well-structured and correct. web/src/ee/refresh-pages/admin/HooksPage/index.tsx — handleValidate isBusy lifecycle Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User
participant C as ConnectedHookCard
participant API as Backend API
U->>C: Click "Test Connection"
C->>C: setIsBusy(true)
C->>API: POST /api/admin/hooks/{id}/validate
API-->>C: HookValidateResponse
C->>C: toast (success or error)
Note over C: finally: setIsBusy(false) ← button re-enabled HERE
C->>API: GET /api/admin/hooks/{id}
API-->>C: HookResponse (updated is_reachable)
C->>C: onToggled(updated) → refresh card state
|
There was a problem hiding this comment.
2 issues found across 4 files
Confidence score: 4/5
- This PR looks safe to merge; the noted issues are low severity and mostly around error handling/UI messaging.
- In
web/src/ee/refresh-pages/admin/HooksPage/index.tsx, a refresh failure can be reported as a validation failure, which may confuse users with misleading/duplicate toasts. - Pay close attention to
web/src/ee/refresh-pages/admin/HooksPage/index.tsxandweb/src/ee/refresh-pages/admin/HooksPage/HookStatusPopover.tsx- error handling and rendering duplication could cause UX drift.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="web/src/ee/refresh-pages/admin/HooksPage/index.tsx">
<violation number="1" location="web/src/ee/refresh-pages/admin/HooksPage/index.tsx:318">
P2: `getHook` refresh is coupled to validation in one catch path, so a refresh failure is reported as a validation failure and can show misleading/duplicate toasts.</violation>
</file>
<file name="web/src/ee/refresh-pages/admin/HooksPage/HookStatusPopover.tsx">
<violation number="1" location="web/src/ee/refresh-pages/admin/HooksPage/HookStatusPopover.tsx:221">
P2: The new unreachable-state branch duplicates the same error-row rendering logic used in the recent-errors branch; extract a shared row/list renderer to avoid drift.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
e0951b3 to
084d875
Compare
🖼️ Visual Regression Report
|
Description
Summary
Motivation: We want to support customer to inject function into certain point in our pipeline.
Eng Doc: https://docs.google.com/document/d/1wCQ4jcuscDLBIuVwzG8yT6UnHVWgIi5gdteOhe1SqhU/edit?tab=t.0
Linear: https://linear.app/onyx-app/project/hooks-14fc5597dc91/overview
UI mocks:
https://www.figma.com/design/sNcHyrXBLtTFDK0ijjMnSk/Admin-Panel?node-id=4756-763808&p=f&m=dev
How Has This Been Tested?
Additional Options