🐛 Fix drilldown z-index, RecordFocus validation, Kyverno docs link#4315
🐛 Fix drilldown z-index, RecordFocus validation, Kyverno docs link#4315clubanderson merged 2 commits intomainfrom
Conversation
…4257, #4282, #4267) - Drilldown modal z-index raised to z-[10000] so it renders above the expanded card overlay (z-[9999]) instead of behind it - RecordFocus handler now checks BodyParser error and returns HTTP 400 on malformed JSON instead of silently proceeding with zero values - Kyverno Policies card documentation link updated from empty /docs/ page to /docs/introduction/ Signed-off-by: Andrew Anderson <andy@clubanderson.com>
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hey @clubanderson — thanks for opening this PR!
This is an automated message. |
There was a problem hiding this comment.
Pull request overview
Fixes three user-facing issues across the console UI and API: drilldown modal layering in expanded card view, server-side validation for malformed RecordFocus payloads, and an updated Kyverno documentation link.
Changes:
- Raised
DrillDownModalz-index so it renders above the expanded card overlay. - Added
BodyParsererror handling inRecordFocusto return HTTP 400 for malformed JSON. - Updated Kyverno Policies card footer documentation link to a non-empty docs page.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| web/src/components/drilldown/DrillDownModal.tsx | Increases modal z-index to ensure drilldown overlays expanded-card modal layer. |
| web/src/components/cards/KyvernoPolicies.tsx | Updates footer “Documentation” URL to the Kyverno introduction page. |
| pkg/api/handlers/cards.go | Returns 400 on JSON parse errors in RecordFocus instead of proceeding with zero-value input. |
| return ( | ||
| <div | ||
| className="fixed inset-0 bg-black/60 backdrop-blur-2xl flex items-center justify-center z-50 p-2 md:p-4" | ||
| className="fixed inset-0 bg-black/60 backdrop-blur-2xl flex items-center justify-center z-[10000] p-2 md:p-4" |
There was a problem hiding this comment.
z-[10000] introduces a new hard-coded z-index value that’s higher than the app’s standard modal layer (e.g., BaseModal uses z-[9999]). To avoid future “z-index arms races” and unintended layering over other overlays, consider centralizing modal z-indexes (Tailwind theme/utility or shared constant) or rendering this modal via the existing BaseModal/portal approach with a defined layer above expanded cards.
| className="fixed inset-0 bg-black/60 backdrop-blur-2xl flex items-center justify-center z-[10000] p-2 md:p-4" | |
| className="fixed inset-0 bg-black/60 backdrop-blur-2xl flex items-center justify-center z-[9999] p-2 md:p-4" |
| var input struct { | ||
| Summary string `json:"summary"` | ||
| } | ||
| c.BodyParser(&input) | ||
| if err := c.BodyParser(&input); err != nil { | ||
| return fiber.NewError(fiber.StatusBadRequest, "Invalid request body") | ||
| } |
There was a problem hiding this comment.
RecordFocus now returns 400 on BodyParser errors, but there’s no handler test covering this regression path. Add a unit test (similar to the existing CreateCard/UpdateCard bad-body tests) that posts malformed JSON to /api/cards/:id/focus, asserts HTTP 400, and asserts UpdateCardFocus is not called.
🔄 Auto-Applying Copilot Code ReviewCopilot code review found 1 code suggestion(s) and 1 general comment(s). @copilot Please apply all of the following code review suggestions:
Also address these general comments:
Push all fixes in a single commit. Run Auto-generated by copilot-review-apply workflow. |
|
/lgtm |
|
@clubanderson: you cannot LGTM your own PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: clubanderson The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…Focus 400 test Signed-off-by: GitHub Copilot <copilot@github.com> Agent-Logs-Url: https://github.com/kubestellar/console/sessions/0f0857f6-2a6f-4a76-8b93-9bc67d0562db Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Done in commit
|
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
📝 Summary of Changes
z-[9999]to match theBaseModallayer, ensuring the drilldown modal renders above the expanded card overlay without introducing an escalating z-index valueRecordFocushandler now checks theBodyParsererror and returns HTTP 400 on malformed JSON, instead of silently proceeding with a zero-value summaryhttps://kyverno.io/docs/(empty page) tohttps://kyverno.io/docs/introduction/Changes Made
DrillDownModalz-index toz-[9999]to align with theBaseModallayer and avoid z-index escalationBodyParsererror check inRecordFocushandler — returns HTTP 400 on malformed JSONTestRecordFocus_BadBody_Returns400— posts malformed JSON toPOST /api/cards/:id/focusand asserts HTTP 400 is returnedChecklist
Please ensure the following before submitting your PR:
git commit -s)Screenshots or Logs (if applicable)
N/A — no visual changes; z-index fix is a layering correction, link fix is a URL update, and RecordFocus fix is a server-side validation change.
👀 Reviewer Notes
z-[10000]toz-[9999]per code review feedback to align with the existingBaseModallayer and avoid introducing an ever-escalating z-index value.TestRecordFocus_BadBody_Returns400test uses a localrecordFocusStorewrapper (embeds*test.MockStoreand overridesGetCard/GetDashboard) so the handler reaches theBodyParserstep in the test.