[management] Add dashboard_features account setting#6742
Conversation
…isibility Introduce a nullable dashboard_features object on account settings, serialized to a single JSON column so new dashboard sections can be added without schema changes. Starts with agent_network (show the Agent Network menu for an account without the deployment flag). Wires the API handler mapping, the pgx GetAccount loader, and adds store round-trip and handler tests.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds per-account dashboard feature overrides for Agent Network. The setting is defined in internal and generated API types, persisted in PostgreSQL, mapped through account HTTP requests and responses, and covered by handler and SQL store tests. ChangesDashboard feature overrides
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant AccountClient
participant AccountsHandler
participant SQLStore
participant PostgreSQL
AccountClient->>AccountsHandler: Update account with dashboard_features
AccountsHandler->>SQLStore: Save account settings
SQLStore->>PostgreSQL: Persist settings_dashboard_features
PostgreSQL-->>SQLStore: Return saved account
SQLStore-->>AccountsHandler: Load DashboardFeatures
AccountsHandler-->>AccountClient: Return dashboard_features
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
shared/management/http/api/openapi.yml (1)
416-418: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOpenAPI description for
agent_networkomits thefalsebehavior.The Go type comment says the field "forces that section shown (true) or hidden (false) regardless of the deployment feature flag," but the OpenAPI description only covers the
truecase. Consider documenting both directions for API consumers.📝 Suggested description update
agent_network: - description: When true, the Agent Network menu is shown for the account even without the deployment feature flag. + description: When true, the Agent Network menu is shown for the account even without the deployment feature flag. When false, the menu is hidden regardless of the deployment feature flag. When omitted, the default behavior applies. type: boolean example: true🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shared/management/http/api/openapi.yml` around lines 416 - 418, Update the OpenAPI description for the agent_network property to document both behaviors: true forces the Agent Network menu to be shown, while false forces it to be hidden, regardless of the deployment feature flag.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@shared/management/http/api/openapi.yml`:
- Around line 416-418: Update the OpenAPI description for the agent_network
property to document both behaviors: true forces the Agent Network menu to be
shown, while false forces it to be hidden, regardless of the deployment feature
flag.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4fba649a-7bd8-4ac6-8a16-fcae056cfd32
📒 Files selected for processing (7)
management/server/http/handlers/accounts/accounts_handler.gomanagement/server/http/handlers/accounts/accounts_handler_test.gomanagement/server/store/sql_store.gomanagement/server/store/sql_store_test.gomanagement/server/types/settings.goshared/management/http/api/openapi.ymlshared/management/http/api/types.gen.go
Release artifactsBuilt for PR head
GHCR images (amd64)
This comment is updated by the Release workflow. Artifact links expire according to the workflow retention policy. |
|



Describe your changes
Adds a per-account
dashboard_featuressetting: a nullable object that overrideswhich dashboard sections are shown for an account. It serializes to a single
JSON column so new sections can be added later as struct fields with no schema
change and no new pgx loader plumbing.
This is the backend for making the Agent Network menu available to existing
accounts (reusing the netbird.ai signup flow), and the general mechanism the
dashboard will use to control other sections (DNS, Reverse Proxy, Networks)
per account later. It starts with a single key,
agent_network— when true theAgent Network menu is shown for the account even without the deployment feature
flag.
agent_network_only(the focused-view mode) stays a separate flag.types.Settings.DashboardFeatures *DashboardFeatures(+Copy)dashboard_features/AccountDashboardFeaturesin the OpenAPI spec,types.gen.goregeneratedPUT/GET /accounts)GetAccountloader updated to select, scan, and unmarshal the JSONcolumn — without it the field silently reads empty in production
handler case setting
dashboard_features.agent_networkAbsent keys follow the default dashboard behavior, so the change is additive and
backward-compatible.
Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
Additive account-setting plumbing surfaced only through the dashboard; the raw
API field is generated into the API reference automatically.
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
Summary by CodeRabbit
agent_networktoggle to control Agent Network menu visibility per account.dashboard_features.dashboard_featuresare correctly loaded from and saved to persistence.