Repository navigation
Widgets on links' tiles, with Uptime Kuma's monitor widget (Phase 5b2) - #50
Merged
Merged
Conversation
… 5b2)
Integrations can now offer widget kinds (IWidgetKind): each declares a
role, an option schema and a default refresh interval, and reads its
service into a WidgetResult (status, a few figures, a description); the
core draws every widget the same way. App widgets (one per link) sit on
the left of a tile's widget row, status widgets as right-aligned pills
that wrap together.
Widgets are stored per link (AddWidgets migration), cascading from their
link and their connection, so removing a connection deletes its widgets;
the Remove confirmation counts them. WidgetFetcher keeps results for each
widget's interval and shares concurrent reads; pages render only cached
results, and widgets.js reads the rest from /widgets/{id} and refreshes
each on its interval, pausing while the tab is hidden.
The link dialog gains a Widgets section (widget-editor.js), posted with
the link and checked by WidgetForm; Undo snapshots carry widgets, and
backups move to format version 7 with each link's widgets naming their
connection. Uptime Kuma's monitor widget shows a monitor's status,
response time and uptime, read from /metrics.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mechanical: adds braces around every single-line body of if/else, loops, using, lock and fixed, following the settings change. No behavioral changes; a second cleanup pass changes nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Save didn't save while a widget's form was open, which was confusing, so Save and Delete are disabled until the widget is finished (Done) or dropped (Cancel). Also update the .editorconfig comment for the always-required braces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The older-format CSharpFormat/FORCE_*_BRACES_STYLE keys still said ONLY_FOR_MULTILINE, contradicting the always-required braces. They didn't affect cleanup, which settles in one pass with them either way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Widgets end to end, as designed in the 5b discussion: roles, storage, a shared fetcher, polling, editing in the link dialog, Undo, backups, and Uptime Kuma's monitor widget as the first kind.
What's in it
h2s.Widgets.Abstractions):WidgetKinds. EachIWidgetKinddeclares a key, a name, a role, an option schema and a default refresh interval.FetchAsyncreturns aWidgetResult: a status (Unknown, Ok, Warning, Error or Inactive), a fewWidgetStats, and aDescriptionsentence, which is both the tooltip and what screen readers hear.Widgetstable (AddWidgets migration) that cascades from both the link and the connection, so removing a connection deletes its widgets. Settings' Remove confirmation says how many.WidgetFetcher(singleton) keeps each result for the widget's interval, under a key that hashes the widget's and the connection's settings so changes show at once. It shares one read among concurrent requests and turns exceptions and a 10-second timeout into "unknown".WidgetServicerenders pages from cached results only, so a slow service never holds up the dashboard.GET /widgets/{id}reads a widget fresh.widgets.jsreads placeholders immediately, then refreshes each widget on its interval and pauses while the tab is hidden.widget-editor.js) to add, edit, reorder and remove widgets, with fields built from the kind's schema byoption-fields.js.WidgetForm: kind known, integration set up, valid options, refresh 15 s to a day, one app widget, at most ten.uptime-kuma/monitor, refreshes every 60 s):/metrics.Unchanged until 5c/5b3
Checked
/metricsWidgetForm(validation and apply)WidgetFetcher(shared read, caching, failures)/widgets/{id}sendingno-storejb cleanupcodeis stable (a third pass on four files whose braces flipped).widgets.jsread it straight away, and it showed an unknown pill, because that copy predates the soak and has no API key./metrics, which needs your API key.🤖 Generated with Claude Code