Skip to content

feat: Configurable dashboard widgets#3917

Open
tvdeyen wants to merge 3 commits into
mainfrom
configurable-dashboard
Open

feat: Configurable dashboard widgets#3917
tvdeyen wants to merge 3 commits into
mainfrom
configurable-dashboard

Conversation

@tvdeyen
Copy link
Copy Markdown
Member

@tvdeyen tvdeyen commented May 28, 2026

Needs #3915 and #3916

What is this pull request for?

Allows to configure dashboard widgets.

Notable changes

Dashboard widgets are now configured in Alchemy.config

Alchemy.configure do |config|
  config.dashboard.tap do |dashboard|
    dashboard.widgets << Alchemy::Admin::Dashboard::Widget.new(id: "MyWidget", loading: "lazy")
    dashboard.stats << Alchemy::Admin::Dashboard::Widget.new(id: "MyStatistic", style: "stat")
  end
end

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@tvdeyen tvdeyen requested a review from a team as a code owner May 28, 2026 06:44
@tvdeyen tvdeyen added the enhancement New feature or enhancement label May 28, 2026
@tvdeyen tvdeyen added this to the 8.3 milestone May 28, 2026
@tvdeyen tvdeyen force-pushed the configurable-dashboard branch from c848c57 to 06fa3dd Compare May 28, 2026 09:46
tvdeyen added 3 commits May 28, 2026 12:42
Defaults that reference constants needing the Rails autoloader (such as
ViewComponents) cannot be evaluated at gem-boot time without forcing
those constants to load before Rails has set up its routes. Passing a
Proc as the default defers evaluation until the option is first read,
by which point the autoloader is ready.
Dashboard widgets are now read from the `Alchemy.config`.
Dashboard stats are now read from the `Alchemy.config`.
@tvdeyen tvdeyen force-pushed the configurable-dashboard branch from 06fa3dd to da62148 Compare May 28, 2026 10:43
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.15%. Comparing base (075cc66) to head (da62148).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3917   +/-   ##
=======================================
  Coverage   98.15%   98.15%           
=======================================
  Files         343      344    +1     
  Lines        8874     8885   +11     
=======================================
+ Hits         8710     8721   +11     
  Misses        164      164           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants