Skip to content

fix(review): address dashboard and docs follow-ups#234

Merged
SantiagoDePolonia merged 1 commit intomainfrom
docs/review-followups
Apr 15, 2026
Merged

fix(review): address dashboard and docs follow-ups#234
SantiagoDePolonia merged 1 commit intomainfrom
docs/review-followups

Conversation

@SantiagoDePolonia
Copy link
Copy Markdown
Contributor

@SantiagoDePolonia SantiagoDePolonia commented Apr 15, 2026

Summary

  • clarify model access override help text and tighten docs copy on benchmarks and values
  • keep runtime refresh success state even when the follow-up dashboard reload fails
  • make sidebar theme controls and collapse handle keyboard accessible
  • fail fast in docs-openapi when node or npx is missing

Verification

  • pre-commit hooks passed
  • dashboard JavaScript unit tests
  • make test-race
  • hot-path performance guard (alloc/byte thresholds)
  • make lint

Summary by CodeRabbit

  • Documentation

    • Refined benchmark and values documentation wording.
  • Accessibility

    • Added focus outline styling for interactive controls.
    • Improved keyboard navigation and ARIA labels for theme and sidebar controls.
  • Bug Fixes

    • Better error handling when dashboard data fails to reload after runtime refresh.
  • Chores

    • Added Node.js tooling validation to build process.
    • Extended test coverage for accessibility and error scenarios.

@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 15, 2026

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

Project Status Preview Updated (UTC)
gomodel 🟢 Ready View Preview Apr 15, 2026, 10:22 AM

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

📝 Walkthrough

Walkthrough

Multiple dashboard files received accessibility improvements and error-handling enhancements. Documentation was rephrased for clarity, the Makefile added tooling preflight checks, CSS styling was updated for focus states and button consistency, JavaScript error handling was refined, and templates were converted to use semantic button elements with ARIA attributes.

Changes

Cohort / File(s) Summary
Build Configuration
Makefile
Added preflight checks to verify node and npx availability before running the docs-openapi target; exits with error if either is missing.
Documentation
docs/about/benchmarks.mdx, docs/about/values.mdx
Rephrased benchmark bullet points and value statements to remove gateway name prefixes and use more direct, declarative language.
Dashboard Styling
internal/admin/dashboard/static/css/dashboard.css
Added :focus-visible outline styles for theme and sidebar toggle buttons; updated .sidebar-toggle with explicit padding, background, and border properties.
Dashboard Logic
internal/admin/dashboard/static/js/dashboard.js
Wrapped refreshDashboardDataAfterRuntimeRefresh() in try/catch within refreshRuntime() to differentiate runtime refresh success from dashboard reload failures.
Dashboard Templates
internal/admin/dashboard/templates/index.html, sidebar.html
Updated UI hint text for model selector; converted sidebar toggle from <div> to semantic <button> with @click; added descriptive title and aria-label attributes to theme controls.
Dashboard Tests
internal/admin/dashboard/static/js/modules/dashboard-layout.test.js, request-cancellation.test.js
Updated shell layout test to verify <button> sidebar toggle; added keyboard accessibility checks for theme buttons and sidebar toggle; added test case for dashboard data reload failure during runtime refresh.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 Focus states shine bright, buttons hug the rules,
Errors now caught gently, no silent falls,
Templates speak clearer with semantic care,
Documentation flows smooth, removing gatekeep walls,
A dashboard reborn in accessibility's arms! 🌟

🚥 Pre-merge checks | ✅ 3
✅ 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 refers to dashboard and docs follow-ups but doesn't capture the primary substantive changes like keyboard accessibility improvements, error handling enhancements, or the Makefile preflight checks.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 docs/review-followups

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/admin/dashboard/static/js/modules/dashboard-layout.test.js`:
- Line 458: The current assertion using assert.match(modelsBlock, /.../) doesn't
explicitly require the new clause about the "effective request `user_path`";
update the regex used in the assert.match call on modelsBlock to include and
anchor the new wording (e.g., require the phrase "effective request `user_path`"
or equivalent exact text) so the help-text test fails if that clause is removed
or altered, ensuring the assertion still checks the rest of the existing
selector-format sentence (provider/model patterns and the managed API
key/user_path behavior).

In `@internal/admin/dashboard/templates/sidebar.html`:
- Around line 50-63: The theme control buttons (elements with class "theme-btn"
and "theme-toggle-mobile" that call setTheme(...) and toggleTheme()) lack
explicit button types causing potential form-submission; add type="button" to
each <button> element for the three theme buttons and the mobile toggle button
so they do not act as submit buttons if placed inside a form.
🪄 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: d3819bf1-ad78-4125-87b4-58a3246ddf9b

📥 Commits

Reviewing files that changed from the base of the PR and between 102ad15 and d0d4efb.

📒 Files selected for processing (9)
  • Makefile
  • docs/about/benchmarks.mdx
  • docs/about/values.mdx
  • internal/admin/dashboard/static/css/dashboard.css
  • internal/admin/dashboard/static/js/dashboard.js
  • internal/admin/dashboard/static/js/modules/dashboard-layout.test.js
  • internal/admin/dashboard/static/js/modules/request-cancellation.test.js
  • internal/admin/dashboard/templates/index.html
  • internal/admin/dashboard/templates/sidebar.html

assert.match(modelsBlock, /class="pagination-btn pagination-btn-primary pagination-btn-with-icon alias-create-btn"[\s\S]*@click="openAliasCreate\(\)"[\s\S]*data-lucide="plus" class="alias-create-icon"[\s\S]*<span>Create Alias<\/span>/);
assert.match(modelsBlock, /class="pagination-btn pagination-btn-primary pagination-btn-with-icon alias-submit-btn"[\s\S]*:disabled="aliasSubmitting"[\s\S]*data-lucide="plus" class="form-action-icon" x-show="aliasFormMode !== 'edit'"[\s\S]*data-lucide="save" class="form-action-icon" x-show="aliasFormMode === 'edit'"[\s\S]*x-text="aliasSubmitting \? 'Saving\.\.\.' : \(aliasFormMode === 'edit' \? 'Save Alias' : 'Create Alias'\)"/);
assert.match(modelsBlock, /class="pagination-btn pagination-btn-primary pagination-btn-with-icon model-access-submit-btn"[\s\S]*:disabled="modelOverrideSubmitting"[\s\S]*data-lucide="save" class="form-action-icon"[\s\S]*x-text="modelOverrideSubmitting \? 'Saving\.\.\.' : 'Save Access'"/);
assert.match(modelsBlock, /The selector uses <code>\/<\/code> for all providers and models, <code>\{provider_name\}\/<\/code> for one provider, or <code>\{provider_name\}\/\{model\}<\/code> for one model\.[\s\S]*managed API key <code>user_path<\/code> when present, otherwise the <code>X-GoModel-User-Path<\/code> request header\./);
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.

⚠️ Potential issue | 🟡 Minor

Tighten the selector help-text assertion to cover the new clause explicitly.

The regex still passes without strictly asserting the newly added “effective request user_path” wording, so that part can regress undetected.

🔍 Suggested assertion update
-    assert.match(modelsBlock, /The selector uses <code>\/<\/code> for all providers and models, <code>\{provider_name\}\/<\/code> for one provider, or <code>\{provider_name\}\/\{model\}<\/code> for one model\.[\s\S]*managed API key <code>user_path<\/code> when present, otherwise the <code>X-GoModel-User-Path<\/code> request header\./);
+    assert.match(modelsBlock, /The selector uses <code>\/<\/code> for all providers and models, <code>\{provider_name\}\/<\/code> for one provider, or <code>\{provider_name\}\/\{model\}<\/code> for one model\.[\s\S]*<code>user_paths<\/code> is matched against the effective request <code>user_path<\/code>:[\s\S]*managed API key <code>user_path<\/code> when present, otherwise the <code>X-GoModel-User-Path<\/code> request header\./);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
assert.match(modelsBlock, /The selector uses <code>\/<\/code> for all providers and models, <code>\{provider_name\}\/<\/code> for one provider, or <code>\{provider_name\}\/\{model\}<\/code> for one model\.[\s\S]*managed API key <code>user_path<\/code> when present, otherwise the <code>X-GoModel-User-Path<\/code> request header\./);
assert.match(modelsBlock, /The selector uses <code>\/<\/code> for all providers and models, <code>\{provider_name\}\/<\/code> for one provider, or <code>\{provider_name\}\/\{model\}<\/code> for one model\.[\s\S]*<code>user_paths<\/code> is matched against the effective request <code>user_path<\/code>:[\s\S]*managed API key <code>user_path<\/code> when present, otherwise the <code>X-GoModel-User-Path<\/code> request header\./);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/admin/dashboard/static/js/modules/dashboard-layout.test.js` at line
458, The current assertion using assert.match(modelsBlock, /.../) doesn't
explicitly require the new clause about the "effective request `user_path`";
update the regex used in the assert.match call on modelsBlock to include and
anchor the new wording (e.g., require the phrase "effective request `user_path`"
or equivalent exact text) so the help-text test fails if that clause is removed
or altered, ensuring the assertion still checks the rest of the existing
selector-format sentence (provider/model patterns and the managed API
key/user_path behavior).

Comment on lines +50 to +63
<button class="theme-btn" :class="{ active: theme === 'light' }" @click="setTheme('light')" title="Light theme" aria-label="Light theme">
<i data-lucide="sun" class="theme-icon" aria-hidden="true"></i>
</button>
<button class="theme-btn" :class="{ active: theme === 'system' }" @click="setTheme('system')" title="System" tabindex="-1">
<button class="theme-btn" :class="{ active: theme === 'system' }" @click="setTheme('system')" title="System theme" aria-label="System theme">
<i data-lucide="monitor" class="theme-icon" aria-hidden="true"></i>
</button>
<button class="theme-btn" :class="{ active: theme === 'dark' }" @click="setTheme('dark')" title="Dark" tabindex="-1">
<button class="theme-btn" :class="{ active: theme === 'dark' }" @click="setTheme('dark')" title="Dark theme" aria-label="Dark theme">
<i data-lucide="moon" class="theme-icon" aria-hidden="true"></i>
</button>
</div>
<button class="theme-toggle-mobile" @click="toggleTheme()" :title="theme === 'light' ? 'Light' : theme === 'dark' ? 'Dark' : 'System'" tabindex="-1">
<button class="theme-toggle-mobile"
@click="toggleTheme()"
:title="theme === 'light' ? 'Light theme' : theme === 'dark' ? 'Dark theme' : 'System theme'"
:aria-label="theme === 'light' ? 'Light theme' : theme === 'dark' ? 'Dark theme' : 'System theme'">
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.

⚠️ Potential issue | 🟡 Minor

Add explicit button types on theme controls.

These buttons currently omit type="button", which is flagged by HTMLHint and can cause unintended form submission behavior if markup is ever nested in a form.

🔧 Proposed fix
-            <button class="theme-btn" :class="{ active: theme === 'light' }" `@click`="setTheme('light')" title="Light theme" aria-label="Light theme">
+            <button type="button" class="theme-btn" :class="{ active: theme === 'light' }" `@click`="setTheme('light')" title="Light theme" aria-label="Light theme">
@@
-            <button class="theme-btn" :class="{ active: theme === 'system' }" `@click`="setTheme('system')" title="System theme" aria-label="System theme">
+            <button type="button" class="theme-btn" :class="{ active: theme === 'system' }" `@click`="setTheme('system')" title="System theme" aria-label="System theme">
@@
-            <button class="theme-btn" :class="{ active: theme === 'dark' }" `@click`="setTheme('dark')" title="Dark theme" aria-label="Dark theme">
+            <button type="button" class="theme-btn" :class="{ active: theme === 'dark' }" `@click`="setTheme('dark')" title="Dark theme" aria-label="Dark theme">
@@
-        <button class="theme-toggle-mobile"
+        <button type="button" class="theme-toggle-mobile"
                 `@click`="toggleTheme()"
                 :title="theme === 'light' ? 'Light theme' : theme === 'dark' ? 'Dark theme' : 'System theme'"
                 :aria-label="theme === 'light' ? 'Light theme' : theme === 'dark' ? 'Dark theme' : 'System theme'">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<button class="theme-btn" :class="{ active: theme === 'light' }" @click="setTheme('light')" title="Light theme" aria-label="Light theme">
<i data-lucide="sun" class="theme-icon" aria-hidden="true"></i>
</button>
<button class="theme-btn" :class="{ active: theme === 'system' }" @click="setTheme('system')" title="System" tabindex="-1">
<button class="theme-btn" :class="{ active: theme === 'system' }" @click="setTheme('system')" title="System theme" aria-label="System theme">
<i data-lucide="monitor" class="theme-icon" aria-hidden="true"></i>
</button>
<button class="theme-btn" :class="{ active: theme === 'dark' }" @click="setTheme('dark')" title="Dark" tabindex="-1">
<button class="theme-btn" :class="{ active: theme === 'dark' }" @click="setTheme('dark')" title="Dark theme" aria-label="Dark theme">
<i data-lucide="moon" class="theme-icon" aria-hidden="true"></i>
</button>
</div>
<button class="theme-toggle-mobile" @click="toggleTheme()" :title="theme === 'light' ? 'Light' : theme === 'dark' ? 'Dark' : 'System'" tabindex="-1">
<button class="theme-toggle-mobile"
@click="toggleTheme()"
:title="theme === 'light' ? 'Light theme' : theme === 'dark' ? 'Dark theme' : 'System theme'"
:aria-label="theme === 'light' ? 'Light theme' : theme === 'dark' ? 'Dark theme' : 'System theme'">
<button type="button" class="theme-btn" :class="{ active: theme === 'light' }" `@click`="setTheme('light')" title="Light theme" aria-label="Light theme">
<i data-lucide="sun" class="theme-icon" aria-hidden="true"></i>
</button>
<button type="button" class="theme-btn" :class="{ active: theme === 'system' }" `@click`="setTheme('system')" title="System theme" aria-label="System theme">
<i data-lucide="monitor" class="theme-icon" aria-hidden="true"></i>
</button>
<button type="button" class="theme-btn" :class="{ active: theme === 'dark' }" `@click`="setTheme('dark')" title="Dark theme" aria-label="Dark theme">
<i data-lucide="moon" class="theme-icon" aria-hidden="true"></i>
</button>
</div>
<button type="button" class="theme-toggle-mobile"
`@click`="toggleTheme()"
:title="theme === 'light' ? 'Light theme' : theme === 'dark' ? 'Dark theme' : 'System theme'"
:aria-label="theme === 'light' ? 'Light theme' : theme === 'dark' ? 'Dark theme' : 'System theme'">
🧰 Tools
🪛 HTMLHint (1.9.2)

[warning] 50-50: The type attribute must be present on elements.

(button-type-require)


[warning] 53-53: The type attribute must be present on

elements.

(button-type-require)


[warning] 56-56: The type attribute must be present on

elements.

(button-type-require)


[warning] 60-60: The type attribute must be present on

elements.

(button-type-require)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/admin/dashboard/templates/sidebar.html` around lines 50 - 63, The
theme control buttons (elements with class "theme-btn" and "theme-toggle-mobile"
that call setTheme(...) and toggleTheme()) lack explicit button types causing
potential form-submission; add type="button" to each <button> element for the
three theme buttons and the mobile toggle button so they do not act as submit
buttons if placed inside a form.

@SantiagoDePolonia SantiagoDePolonia merged commit cc9e033 into main Apr 15, 2026
17 checks passed
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.

1 participant