Fix default dashboard Widget Error and auto-redirect to editor - #7
Merged
Conversation
…et palette The default dashboard referenced a non-existent `alert-banner` widget type, causing a "Widget Error" on first load. Now the default dashboard starts empty, and empty editable dashboards auto-redirect to the editor with the widget palette open so users can immediately start adding widgets. Closes #6 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When an empty editable dashboard is viewed, check if any plugins are enabled for the current server. If none are enabled, redirect to the plugins settings page so the user can enable plugins first (which registers widgets). Only redirect to the dashboard editor with the widget palette open when plugins are already enabled. Closes #6 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the first-load “Widget Error” on the default dashboard by removing the reference to a non-existent widget type, and improves the empty-dashboard experience by redirecting users into the editor with the widget palette open.
Changes:
- Default dashboard creation now produces an empty dashboard (no widgets), avoiding the missing
alert-bannerwidget type. - Viewing an empty, editable dashboard redirects to edit mode with
open_palette=1. - Editor template/JS updated to support auto-opening and auto-initializing the widget palette on load.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| gearbox/internal/framework/dashboard/storage.go | Stops creating the default dashboard with the missing alert-banner widget by creating it empty. |
| gearbox/internal/framework/handler/dashboard.go | Redirects empty editable dashboards into edit mode and wires open_palette into the editor page render. |
| gearbox/internal/framework/templates/pages/dashboard_editor.templ | Adds openPalette parameter and conditionally renders the palette panel as visible on load. |
| gearbox/static/js/dashboard/palette.js | Auto-initializes palette on page load when the panel is already visible. |
After creating a new server, redirect to the plugins settings page (instead of the boxes list) so the user can enable plugins immediately. Add a "Done" button to the plugins page that navigates to the home dashboard. Remove the empty-dashboard redirect logic from ViewDashboard since the user now goes through plugin setup first. Closes #6 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ugin - Hide Dashboard link and sidebar nav items when no plugins are enabled - OverviewPage (/) now redirects to the first enabled plugin page instead of always going to /dashboards/dashboard - When no plugins are enabled, redirect to /settings/plugins - Add hasAnyEnabledIntegration() and integrationPath() helpers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… type The users table uses TEXT PRIMARY KEY (UUID), but the plugins table defined updated_by as INTEGER and the Go struct used *int64. This caused a scan error when reading plugins after toggling them, since the stored value is a UUID string. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Dashboard link was still showing conditionally. Per user request, remove it completely — only plugin-specific pages appear in the sidebar. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
API routes in main.go used {serverID} but all handlers extract
chi.URLParam(r, "boxID"), causing every API endpoint to return 400
"Server ID required". Changed route definitions back to {boxID} to
match the handlers.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
alert-bannerwidget type that caused "Widget Error" on first loadChanges
CreateDefaultDashboard()now creates a dashboard with zero widgets instead of referencing the missingalert-bannerwidgetViewDashboard()redirects empty editable dashboards to/edit?open_palette=1;EditDashboardPage()passesopenPaletteto the templateopenPalette boolparam; palette panel renders withouthiddenclass when trueTest plan
gearbox/data/dashboards/dashboard.yamland restart the app/dashboards/dashboard— should redirect to/dashboards/dashboard/edit?open_palette=1Closes #6
🤖 Generated with Claude Code