Skip to content

feat(dashboard): refine virtual model and API key actions - #575

Merged
SantiagoDePolonia merged 2 commits into
mainfrom
fix/ui-fixes
Jul 22, 2026
Merged

feat(dashboard): refine virtual model and API key actions#575
SantiagoDePolonia merged 2 commits into
mainfrom
fix/ui-fixes

Conversation

@SantiagoDePolonia

@SantiagoDePolonia SantiagoDePolonia commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep standalone virtual models at the top of the model list and replace text badges with compact icons
  • simplify virtual-model writes so policies and redirects share one upsert path, prune behaviorally empty records, and allow clean policy/redirect transitions
  • preserve access settings when removing a redirect and unify model-row action ordering and active edit indicators
  • keep API key row actions inline and replace text actions with accessible titled icons

Testing

  • go test ./...
  • node --test internal/admin/dashboard/static/js/modules/*.test.cjs
  • git diff --check
  • repository pre-commit hook suite

Summary by CodeRabbit

  • New Features / UI
    • Virtual model aliases and redirects now render under a dedicated “Virtual models” section with clearer inline alias/redirect icons and an inline redirect remove control.
    • API key actions were updated to icon-only, accessible buttons with improved alignment in the actions column.
  • Bug Fixes
    • No-op or redundant access policies are pruned automatically, and affected access is reported as reset to inherited/default.
    • Upserts correctly replace policy↔redirect views without leaving behind conflicting targets or user-path overrides.
  • Documentation
    • API docs now document the PUT /admin/virtual-models 204 response for no-op access policy removal.

Copilot AI review requested due to automatic review settings July 22, 2026 12:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 111d9ee1-1343-4b90-ad90-51da6671fb65

📥 Commits

Reviewing files that changed from the base of the PR and between fc04caf and 6902cc0.

📒 Files selected for processing (3)
  • docs/features/virtual-models.mdx
  • internal/admin/handler_virtualmodels_test.go
  • internal/virtualmodels/service.go

📝 Walkthrough

Walkthrough

Changes

Virtual model policy lifecycle

Layer / File(s) Summary
Policy redundancy and replacement
internal/virtualmodels/service.go, internal/virtualmodels/validation.go, internal/virtualmodels/*_test.go
Upsert and rename operations normalize policies, prune redundant rows, and replace redirects and policies across kinds.
Admin API behavior and contract
internal/admin/handler_virtualmodels*, cmd/gomodel/docs/docs.go, docs/openapi.json, docs/features/virtual-models.mdx
Admin tests cover cross-kind replacement, while API specifications document the 204 no-op removal response.
Virtual-model dashboard flow
internal/admin/dashboard/static/js/modules/virtual-models*, internal/admin/dashboard/templates/model-table-body.html, internal/admin/dashboard/static/css/dashboard.css, internal/admin/dashboard/static/js/modules/dashboard-layout.test.cjs
The dashboard separates virtual-model groups, renders icons, relocates redirect removal, centralizes mutations, and reports access resets.

API key dashboard actions

Layer / File(s) Summary
API key action controls
internal/admin/dashboard/templates/page-auth-keys.html, internal/admin/dashboard/templates/power-icon.html, internal/admin/dashboard/static/css/dashboard.css, internal/admin/dashboard/static/js/modules/dashboard-layout.test.cjs
API key rows now render labeled icon actions with inline layout styling and a reusable power icon.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Dashboard
  participant AdminAPI
  participant VirtualModelService
  participant Store
  Dashboard->>AdminAPI: submit virtual-model policy
  AdminAPI->>VirtualModelService: upsert policy
  VirtualModelService->>Store: delete redundant row or persist changed row
  Store-->>VirtualModelService: storage result
  VirtualModelService-->>AdminAPI: 200 or 204 response
  AdminAPI-->>Dashboard: display saved or reset notice
Loading

Possibly related PRs

Suggested reviewers: copilot

Poem

I’m a rabbit pruning rows with care,
Resetting access to defaults there.
Icons hop neatly, buttons align,
Redirects shift to a clearer line.
Policies sleep when they do no more.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main dashboard virtual model and API key action changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ui-fixes

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.

@mintlify

mintlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
gomodel 🟢 Ready View Preview Jul 22, 2026, 12:21 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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.

Inline comments:
In `@docs/features/virtual-models.mdx`:
- Around line 30-35: Revise the virtual-models documentation to describe
empty-policy pruning as GoModel/backend behavior enforced by the virtual-model
API, rather than as dashboard-only behavior. Replace “The dashboard does not
persist” with wording that applies to all callers of `/admin/virtual-models`,
while preserving the existing conditions for removing or retaining stored
policies.

In `@internal/admin/handler_virtualmodels_test.go`:
- Around line 402-433: Extend TestUpsertRedirectVirtualModelReplacesAccessPolicy
to assert that the resulting redirect view has no UserPaths after the PUT body
omits user_paths, confirming full-replacement semantics. Keep the existing
redirect and target assertions unchanged.

In `@internal/virtualmodels/service.go`:
- Around line 378-392: Align the rename flow’s operation ordering with Upsert:
perform the redundancy check before validateRedirectTarget, while preserving the
existing redirect short-circuit behavior and redundant-policy deletion/refresh
handling in the rename path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 70389c28-7327-4d6d-9dc4-09196d80b72a

📥 Commits

Reviewing files that changed from the base of the PR and between 754cb88 and fc04caf.

📒 Files selected for processing (16)
  • cmd/gomodel/docs/docs.go
  • docs/features/virtual-models.mdx
  • docs/openapi.json
  • internal/admin/dashboard/static/css/dashboard.css
  • internal/admin/dashboard/static/js/modules/dashboard-layout.test.cjs
  • internal/admin/dashboard/static/js/modules/virtual-models.js
  • internal/admin/dashboard/static/js/modules/virtual-models.test.cjs
  • internal/admin/dashboard/templates/model-table-body.html
  • internal/admin/dashboard/templates/page-auth-keys.html
  • internal/admin/dashboard/templates/power-icon.html
  • internal/admin/handler_virtualmodels.go
  • internal/admin/handler_virtualmodels_test.go
  • internal/virtualmodels/rename_test.go
  • internal/virtualmodels/service.go
  • internal/virtualmodels/service_test.go
  • internal/virtualmodels/validation.go
💤 Files with no reviewable changes (1)
  • internal/virtualmodels/validation.go

Comment thread docs/features/virtual-models.mdx Outdated
Comment thread internal/admin/handler_virtualmodels_test.go
Comment thread internal/virtualmodels/service.go
@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

This looks safe to merge.

No blocking issues found in the changed code.

T-Rex T-Rex Logs

What T-Rex did

  • Validated the before and after UI changes by confirming that Virtual models is the first group, icon affordances render, alias edit is active, and API-key actions are compact icon buttons.
  • Opened the real alias edit flow and observed the virtual-model editor opening from the active alias edit action.
  • Opened the API-keys editor via the compact edit icon and observed the labels editor.
  • Inspected system logs and responses to confirm that unrelated dashboard services returned 503s without blocking the validated pages.
  • Captured validation videos and screenshots documenting the end-to-end UI changes and in-flow interactions.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "feat(dashboard): refine virtual model an..." | Re-trigger Greptile

Copilot AI review requested due to automatic review settings July 22, 2026 12:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@SantiagoDePolonia
SantiagoDePolonia merged commit f7dcbae into main Jul 22, 2026
20 checks passed
@mintlify

mintlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
gomodel 🟡 Building Jul 22, 2026, 12:20 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

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