Skip to content

🐛 Fix drilldown z-index, RecordFocus validation, Kyverno docs link#4315

Merged
clubanderson merged 2 commits intomainfrom
fix/small-ui-backend-fixes
Apr 2, 2026
Merged

🐛 Fix drilldown z-index, RecordFocus validation, Kyverno docs link#4315
clubanderson merged 2 commits intomainfrom
fix/small-ui-backend-fixes

Conversation

@clubanderson
Copy link
Copy Markdown
Collaborator

@clubanderson clubanderson commented Apr 2, 2026

Adding or modifying a card/dashboard? Read the Card Development Guide first — it covers required patterns, common pitfalls, and the full file checklist.

New CNCF project card? New cards go in kubestellar/console-marketplace, not this repo. PRs adding new cards here will be redirected.

Use a coding agent. This repo is primarily developed with Claude Code (Opus 4.5/4.6). It knows all codebase patterns (isDemoData, useCardLoadingState, locale strings, DCO). Manual PRs that miss required patterns will be sent back.


📝 Summary of Changes


Changes Made

  • Updated DrillDownModal z-index to z-[9999] to align with the BaseModal layer and avoid z-index escalation
  • Added BodyParser error check in RecordFocus handler — returns HTTP 400 on malformed JSON
  • Updated Kyverno Policies card footer documentation URL to the introduction page
  • Added unit test TestRecordFocus_BadBody_Returns400 — posts malformed JSON to POST /api/cards/:id/focus and asserts HTTP 400 is returned

Checklist

Please ensure the following before submitting your PR:

  • I used a coding agent (Claude Code, Copilot, Gemini, or Codex) to generate/review this code
  • I have reviewed the project's contribution guidelines
  • New cards target console-marketplace, not this repo
  • isDemoData is wired correctly (cards show Demo badge when using demo data)
  • I have written unit tests for the changes (if applicable)
  • I have tested the changes locally and ensured they work as expected
  • All commits are signed with DCO (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

  • The DrillDownModal z-index was revised from z-[10000] to z-[9999] per code review feedback to align with the existing BaseModal layer and avoid introducing an ever-escalating z-index value.
  • The TestRecordFocus_BadBody_Returns400 test uses a local recordFocusStore wrapper (embeds *test.MockStore and overrides GetCard/GetDashboard) so the handler reaches the BodyParser step in the test.

…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>
@kubestellar-prow kubestellar-prow bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Apr 2, 2026
Copilot AI review requested due to automatic review settings April 2, 2026 19:18
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 2, 2026

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit 9ced41b
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/69ced280c9e55a000804a625
😎 Deploy Preview https://deploy-preview-4315.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

👋 Hey @clubanderson — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@kubestellar-prow kubestellar-prow bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DrillDownModal z-index so it renders above the expanded card overlay.
  • Added BodyParser error handling in RecordFocus to 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"
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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"

Copilot uses AI. Check for mistakes.
Comment on lines 199 to +204
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")
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@clubanderson
Copy link
Copy Markdown
Collaborator Author

🔄 Auto-Applying Copilot Code Review

Copilot code review found 1 code suggestion(s) and 1 general comment(s).

@copilot Please apply all of the following code review suggestions:

  • web/src/components/drilldown/DrillDownModal.tsx (line 303): className="fixed inset-0 bg-black/60 backdrop-blur-2xl flex items-center justify...

Also address these general comments:

  • pkg/api/handlers/cards.go (line 204): RecordFocus now returns 400 on BodyParser errors, but there’s no handler test covering this regression path. Add a uni

Push all fixes in a single commit. Run cd web && npm run build && npm run lint before committing.


Auto-generated by copilot-review-apply workflow.

@clubanderson
Copy link
Copy Markdown
Collaborator Author

/lgtm
/approve

@kubestellar-prow
Copy link
Copy Markdown
Contributor

@clubanderson: you cannot LGTM your own PR.

Details

In response to this:

/lgtm
/approve

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.

@kubestellar-prow
Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 2, 2026
…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>
@kubestellar-prow kubestellar-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

🔄 Auto-Applying Copilot Code Review

Copilot code review found 1 code suggestion(s) and 1 general comment(s)....

Done in commit 9ced41b:

  1. DrillDownModal z-index: Reverted from z-[10000] back to z-[9999] per the review suggestion — this aligns with the existing BaseModal layer rather than creating a higher arbitrary layer.

  2. RecordFocus test: Added TestRecordFocus_BadBody_Returns400 in pkg/api/handlers/cards_test.go. The test uses a local recordFocusStore wrapper that overrides GetCard/GetDashboard to return a valid card and matching dashboard, so the handler reaches the BodyParser step. Posting {invalid json with Content-Type: application/json asserts HTTP 400 is returned.

@clubanderson clubanderson merged commit eb33460 into main Apr 2, 2026
25 of 26 checks passed
@kubestellar-prow kubestellar-prow bot deleted the fix/small-ui-backend-fixes branch April 2, 2026 20:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants