Skip to content

Fix default dashboard Widget Error and auto-redirect to editor - #7

Merged
sarg3nt merged 8 commits into
mainfrom
fix/default-dashboard-empty-widget
Feb 1, 2026
Merged

Fix default dashboard Widget Error and auto-redirect to editor#7
sarg3nt merged 8 commits into
mainfrom
fix/default-dashboard-empty-widget

Conversation

@sarg3nt

@sarg3nt sarg3nt commented Feb 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixed default dashboard referencing non-existent alert-banner widget type that caused "Widget Error" on first load
  • Empty editable dashboards now auto-redirect to edit mode with the widget palette panel already open
  • Users can immediately start adding widgets when they first set up a server

Changes

  • storage.go: CreateDefaultDashboard() now creates a dashboard with zero widgets instead of referencing the missing alert-banner widget
  • dashboard.go: ViewDashboard() redirects empty editable dashboards to /edit?open_palette=1; EditDashboardPage() passes openPalette to the template
  • dashboard_editor.templ: Accepts openPalette bool param; palette panel renders without hidden class when true
  • palette.js: Auto-initializes the widget palette on page load when the panel is already visible

Test plan

  • Delete gearbox/data/dashboards/dashboard.yaml and restart the app
  • Verify the default dashboard is created with no widgets
  • Navigate to /dashboards/dashboard — should redirect to /dashboards/dashboard/edit?open_palette=1
  • Verify the editor loads with the widget palette already open and populated
  • Verify existing non-empty dashboards still render normally (no redirect)
  • Verify toggling the palette open/closed still works in the editor

Closes #6

🤖 Generated with Claude Code

…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>
Copilot AI review requested due to automatic review settings February 1, 2026 21:13
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>

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.

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-banner widget 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.

Comment thread gearbox/static/js/dashboard/palette.js
sarg3nt and others added 2 commits February 1, 2026 13:28
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>
Copilot AI review requested due to automatic review settings February 1, 2026 21:39
… 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>

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Comment thread gearbox/internal/framework/handler/dashboard.go
Comment thread gearbox/internal/framework/dashboard/storage.go Outdated
Comment thread gearbox/internal/plugins/dashboard/handlers.go
Comment thread gearbox/internal/framework/templates/layouts/base.templ Outdated
Comment thread gearbox/internal/framework/templates/layouts/base.templ
sarg3nt and others added 2 commits February 1, 2026 13:52
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>
Copilot AI review requested due to automatic review settings February 1, 2026 21:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Comment thread gearbox/cmd/server/main.go
Comment thread gearbox/internal/plugins/dashboard/handlers.go
@sarg3nt
sarg3nt merged commit ec83ffe into main Feb 1, 2026
17 checks passed
@sarg3nt
sarg3nt deleted the fix/default-dashboard-empty-widget branch May 12, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default dashboard shows Widget Error for missing alert-banner widget

2 participants