Skip to content

fix(dashboard): polish demo and provider management - #569

Merged
SantiagoDePolonia merged 5 commits into
mainfrom
feat/batch-of-improvements
Jul 21, 2026
Merged

fix(dashboard): polish demo and provider management#569
SantiagoDePolonia merged 5 commits into
mainfrom
feat/batch-of-improvements

Conversation

@SantiagoDePolonia

@SantiagoDePolonia SantiagoDePolonia commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve stored provider secrets when dashboard edits submit redacted asterisk placeholders, while showing a longer mask
  • remove models immediately when a dashboard-managed provider is deleted and prevent stale in-flight refreshes from restoring them
  • add website, documentation, and GitHub links to the demo banner and keep the banner in normal page flow
  • make the shared date-range picker sticky on Overview, Usage, and Audit Logs
  • compact large token counts with K/M/B suffixes and expose exact input, output, and total values on hover
  • shorten provider-health summaries and reduce the overview card width
  • explain temporary live audit entries when persistence is disabled and document demo authentication behavior

Behavior notes

  • demo mode remains a warning/display mode and does not bypass authentication or reset storage
  • persisted managed gateway keys continue to enforce authentication without a master key
  • live dashboard audit previews remain independent from persisted audit logging

Tests

  • go test ./cmd/... ./internal/... ./config/...
  • node --test internal/admin/dashboard/static/js/modules/*.test.cjs
  • repository pre-commit hooks: race tests, lint, formatting, performance guard, and Mintlify validation

Summary by CodeRabbit

  • New Features
    • Added outbound links to the dashboard demo-mode banner.
    • Improved token counters with compact formatting and clearer tooltips.
    • Added sticky date-range controls across dashboard pages.
    • Enhanced the models page with smoother, incremental rendering and faster filtering feedback.
    • Added an audit logging warning when audit persistence is disabled.
  • Bug Fixes
    • Provider models are removed immediately, and stale refreshes can’t reintroduce them.
    • Masked provider credential values are better preserved during updates, including longer all-asterisk placeholders.
  • Documentation
    • Updated demo-mode auth/logging and credential redaction/masking documentation.

Models page performance follow-up

  • index concrete model selectors once when matching virtual models and aliases
  • progressively mount large model inventories in paint-separated batches so the page remains interactive
  • show a sticky loading/rendering indicator with rendered and total model counts
  • restart bounded rendering when filters or model inventory data change

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@SantiagoDePolonia, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ccf79fa6-0d45-4abe-a43b-517bda0a1ba0

📥 Commits

Reviewing files that changed from the base of the PR and between e49181e and eac3bfe.

📒 Files selected for processing (3)
  • internal/admin/dashboard/dashboard_test.go
  • internal/admin/dashboard/static/js/modules/dashboard-layout.test.cjs
  • internal/admin/dashboard/templates/layout.html
📝 Walkthrough

Walkthrough

The changes update dashboard layouts, incremental model rendering, token and provider-status displays, provider credential masking, and provider registry cleanup. Documentation and tests cover authentication, audit logging, masking behavior, rendering, and stale model removal.

Changes

Dashboard UI and documentation

Layer / File(s) Summary
Dashboard layout and banner structure
docs/advanced/configuration.mdx, internal/admin/dashboard/..., internal/admin/dashboard/templates/*.html
Demo-mode links, sticky date-range layouts, responsive styling, provider card placement, and audit logging warnings are added and tested.
Incremental models rendering
internal/admin/dashboard/static/js/dashboard.js, internal/admin/dashboard/static/js/modules/virtual-models.js, internal/admin/dashboard/templates/page-models.html
The models page renders grouped inventories in bounded asynchronous batches and restarts rendering on route and filter changes.
Token and provider-status display
internal/admin/dashboard/static/js/dashboard.js, internal/admin/dashboard/static/js/modules/providers.js, internal/admin/dashboard/templates/page-overview.html
Token counts gain validated compact formatting and exact-count tooltips, while provider-status summaries use shorter health-state messages.

Provider credential masking

Layer / File(s) Summary
Credential mask contract and UI guidance
CLAUDE.md, internal/admin/dashboard/templates/page-providers-config.html
Documentation and form hints use an eleven-asterisk mask and describe masked-value clearing behavior.
Redaction-aware credential upserts
internal/admin/handler_provider_credentials.go, internal/admin/handler_provider_credentials_test.go
Secret responses use the new mask, and valid all-asterisk placeholders preserve stored values during upserts.
Masked credential form expectations
internal/admin/dashboard/static/js/modules/providers-config.test.cjs
Frontend credential tests update masked values and verify untouched masked key positions remain preserved.

Provider registry cleanup

Layer / File(s) Summary
Immediate unregister cleanup
internal/providers/registry.go
Unregistering a provider immediately removes its models and rebuilds the live catalog.
Stale inventory filtering
internal/providers/registry_init.go, internal/providers/registry_provider_refresh.go
Fetched models and runtime updates for unregistered providers are removed before inventory application.
Unregister and refresh validation
internal/providers/registry_unregister_test.go
Tests cover immediate removal, overlapping-model promotion, and stale refresh protection.

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

Possibly related PRs

Poem

A rabbit counts models, batch by batch,
While stars keep secrets in a mask.
Sticky dates and links appear,
Stale models disappear.
Hop, hop, update everything!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% 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 relevant, capturing the main dashboard demo and provider-management changes in the PR.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/batch-of-improvements

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 21, 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 21, 2026, 10:58 AM

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

@codecov-commenter

codecov-commenter commented Jul 21, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 96.55172% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/providers/registry_init.go 95.23% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

The provider refresh reconciliation race needs to be fixed before merging.

Same-name registration lets stale inventory from a replaced provider pass the new filter. Requests can route through the old provider instance and credentials until another refresh succeeds. The remaining dashboard and redaction changes match their documented behavior.

internal/providers/registry_init.go and internal/providers/registry_provider_refresh.go

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex attempted a focused concurrency repro to verify that the replacement accepts stale inventory by blocking the old provider's ListModels call and inspecting routing identities, but the test execution timed out before producing runtime output.
  • The UI changes were validated by showing the banner became static and all three expected external links appeared with correct destinations.
  • The main pages — Overview, Usage, and Audit Logs — rendered successfully and the shared date-range picker opened on Usage and Audit Logs.
  • Artifacts were captured that illustrate the updated banner, the Usage and Audit Logs pages, and the related UI states, supporting a normal PR review/merge recommendation.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "perf(dashboard): render model inventory ..." | Re-trigger Greptile

Comment thread internal/providers/registry_init.go

@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: 1

🤖 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 `@internal/admin/dashboard/static/js/modules/virtual-models.test.cjs`:
- Around line 108-159: Add a test covering scheduleModelRenderBatch aborting
when navigation leaves the Models page: initialize a large model list, call
syncDisplayModels, change module.page away from 'models' before callbacks run,
then execute the queued animation-frame and timer callbacks and assert
modelRenderLimit remains at the initial batch size. Use the existing
createAliasesModule setup and verify no further batch progression occurs.
🪄 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: 93814881-be96-4bc6-af5a-a5b468f0772f

📥 Commits

Reviewing files that changed from the base of the PR and between 4f01cc8 and 8fb3b9b.

📒 Files selected for processing (7)
  • internal/admin/dashboard/static/css/dashboard.css
  • internal/admin/dashboard/static/js/dashboard.js
  • internal/admin/dashboard/static/js/modules/dashboard-display.test.cjs
  • 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/page-models.html

Comment thread internal/admin/dashboard/static/js/modules/virtual-models.test.cjs

@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: 1

🤖 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 `@internal/admin/dashboard/templates/layout.html`:
- Around line 87-89: Complete the demo-banner link contract: in
internal/admin/dashboard/templates/layout.html:87-89, add documentation and
GitHub anchors beside the website link while preserving safe external-link
attributes; in internal/admin/dashboard/dashboard_test.go:102-111, replace
negative assertions with table-driven positive checks for all required links; in
internal/admin/dashboard/static/js/modules/dashboard-layout.test.cjs:105-110,
assert that the documentation and GitHub links are present.
🪄 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: 29746ad7-4c8d-40b8-b448-bec39dc969bd

📥 Commits

Reviewing files that changed from the base of the PR and between 8fb3b9b and b9dec1f.

📒 Files selected for processing (3)
  • internal/admin/dashboard/dashboard_test.go
  • internal/admin/dashboard/static/js/modules/dashboard-layout.test.cjs
  • internal/admin/dashboard/templates/layout.html

Comment on lines +87 to +89
<nav class="demo-mode-banner-links" aria-label="GoModel website">
<a href="https://gomodel.enterpilot.io/" target="_blank" rel="noopener noreferrer">gomodel.enterpilot.io</a>
</nav>

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Complete the demo-banner link contract.

The template omits two links required by the PR objective, and both tests currently enforce that omission.

  • internal/admin/dashboard/templates/layout.html#L87-L89: add documentation and GitHub anchors alongside the website link, preserving safe external-link attributes.
  • internal/admin/dashboard/dashboard_test.go#L102-L111: replace the negative assertions with table-driven positive checks for all required links.
  • internal/admin/dashboard/static/js/modules/dashboard-layout.test.cjs#L105-L110: assert that the documentation and GitHub links are present rather than absent.
📍 Affects 3 files
  • internal/admin/dashboard/templates/layout.html#L87-L89 (this comment)
  • internal/admin/dashboard/dashboard_test.go#L102-L111
  • internal/admin/dashboard/static/js/modules/dashboard-layout.test.cjs#L105-L110
🤖 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 `@internal/admin/dashboard/templates/layout.html` around lines 87 - 89,
Complete the demo-banner link contract: in
internal/admin/dashboard/templates/layout.html:87-89, add documentation and
GitHub anchors beside the website link while preserving safe external-link
attributes; in internal/admin/dashboard/dashboard_test.go:102-111, replace
negative assertions with table-driven positive checks for all required links; in
internal/admin/dashboard/static/js/modules/dashboard-layout.test.cjs:105-110,
assert that the documentation and GitHub links are present.

Source: Coding guidelines

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/providers/registry_unregister_test.go (1)

139-144: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Include sourceProviders to properly exercise the unregistration check.

The fetchedInventory literal is missing the sourceProviders map. Because reading from a nil map in Go returns ok = false, fetchedProviderStillRegisteredLocked will return early and drop the provider simply because it is missing from sourceProviders, rather than because its registered flag is false in providerRuntime.

Adding sourceProviders ensures the test exercises the actual unregistration state validation.

💚 Proposed fix
 		registry.applyFetchedInventory(map[core.Provider]string{drop: "test"}, fetchedInventory{
 			models:           map[string]*ModelInfo{"stale-model": staleModel},
 			modelsByProvider: map[string]map[string]*ModelInfo{"drop": {"stale-model": staleModel}},
 			runtimeUpdates:   map[string]providerRuntimeState{"drop": {registered: true}},
+			sourceProviders:  map[string]core.Provider{"drop": drop},
 			totalModels:      1,
 		}, 1)
🤖 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 `@internal/providers/registry_unregister_test.go` around lines 139 - 144,
Update the fetchedInventory literal in the registry unregistration test to
include a sourceProviders entry for “drop”, so
fetchedProviderStillRegisteredLocked reaches and validates the providerRuntime
registered state instead of returning early for a missing map entry.
🤖 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.

Outside diff comments:
In `@internal/providers/registry_unregister_test.go`:
- Around line 139-144: Update the fetchedInventory literal in the registry
unregistration test to include a sourceProviders entry for “drop”, so
fetchedProviderStillRegisteredLocked reaches and validates the providerRuntime
registered state instead of returning early for a missing map entry.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b0d1064e-d56e-473b-a1d1-b80acd995234

📥 Commits

Reviewing files that changed from the base of the PR and between b9dec1f and e49181e.

📒 Files selected for processing (4)
  • internal/admin/dashboard/static/js/modules/virtual-models.test.cjs
  • internal/providers/registry_init.go
  • internal/providers/registry_provider_refresh.go
  • internal/providers/registry_unregister_test.go

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