Skip to content

Conversation

@adityathebe
Copy link
Member

@adityathebe adityathebe commented Dec 11, 2025

fixes regression introduced in : #2766

Summary by CodeRabbit

  • New Features
    • Views now accept external variables that merge with URL parameters, providing enhanced flexibility in variable management and enabling more sophisticated configuration options across view sections and components. This improvement allows for better control over view behavior and data handling.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
aws-preview Ready Ready Preview Dec 11, 2025 2:37pm
flanksource-ui Ready Ready Preview Dec 11, 2025 2:37pm

@coderabbitai
Copy link

coderabbitai bot commented Dec 11, 2025

Walkthrough

This PR extends ViewSection and ViewWithSections components to accept and propagate external variables as props, enabling variable merging with runtime URL-based parameters throughout the view component hierarchy.

Changes

Cohort / File(s) Change Summary
Variables propagation in view components
src/pages/views/components/ViewSection.tsx, src/pages/views/components/ViewWithSections.tsx
ViewSection now accepts a variables prop (Record<string, string>) and merges it with URL-derived parameters using memoized values; ViewWithSections propagates merged currentVariables to ViewSection instances in both primary and mapped section contexts

Possibly related PRs

Suggested reviewers

  • moshloop

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: adding missing variables prop to the ViewSection component for variable passing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/missing-variables-in-view-section

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ae198b and 62cf330.

📒 Files selected for processing (2)
  • src/pages/views/components/ViewSection.tsx (3 hunks)
  • src/pages/views/components/ViewWithSections.tsx (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/pages/views/components/ViewWithSections.tsx (1)
src/pages/audit-report/types/index.ts (1)
  • ViewSection (424-428)
src/pages/views/components/ViewSection.tsx (1)
src/pages/audit-report/types/index.ts (1)
  • ViewSection (424-428)
🔇 Additional comments (2)
src/pages/views/components/ViewWithSections.tsx (1)

56-63: Wire currentVariables through all ViewSection instances

Forwarding currentVariables via variables={currentVariables} to both the primary ViewSection and each mapped section keeps all sections aligned with the parent view’s current variable set and matches the new ViewSectionProps.variables API. This should address the missing-variables issue without changing visibility behavior (hideVariables) in nested views.

Also applies to: 67-78

src/pages/views/components/ViewSection.tsx (1)

12-22: Variable merge and propagation in ViewSection look consistent

Using the new variables prop (aliased to defaultVariables) and building currentViewVariables by spreading defaultVariables first and URL-derived paramVariables second gives URL params precedence over defaults, then reuses that merged object in both the fetch and the nested <View>’s currentVariables prop. This is a clean way to inject parent defaults while still allowing runtime overrides, and it should fix the missing-variables behavior for sections.

Can you confirm that “URL overrides defaults” is the intended precedence for all callers, including aggregator views?

Also applies to: 30-37, 45-48, 140-142


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@adityathebe adityathebe merged commit d78c89e into main Dec 11, 2025
14 of 16 checks passed
@adityathebe adityathebe deleted the fix/missing-variables-in-view-section branch December 11, 2025 14:51
@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for clerk-saas-ui failed. Why did it fail? →

Name Link
🔨 Latest commit 62cf330
🔍 Latest deploy log https://app.netlify.com/projects/clerk-saas-ui/deploys/693ad5d7f8ae610008336830

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for flanksource-demo-stable failed. Why did it fail? →

Name Link
🔨 Latest commit 62cf330
🔍 Latest deploy log https://app.netlify.com/projects/flanksource-demo-stable/deploys/693ad5d7c71d5000089a0fda

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants