Repository navigation
fix: hide widgets with nothing to show and draw graphs from the right - #381
Merged
Merged
Conversation
|
🎉 This PR is included in version 0.10.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Problem
A widget that hasn't loaded, or whose script failed, looks broken on the bar. A script widget whose layout shows nothing yet draws an empty pill, and when its script fails the bar shows only a red dot. The CPU graph starts blank, reads 0% on its first sample, and fills from the left over 60 samples.
Fixes #379
Fixes #380
Changes
hideWhenEmptyhides every block, is now hidden the same way as an output withhidden: true, so it fades out with the widget's transition. The check is the one edit mode already used for placeholders, moved toBarEditing.hasContent. The store sets it with the presentation'shidden, so the bar view invalidates only when it changes, not on every output. Providers withwhenVisibleare left out: they pause while hidden, so they would never send their first output.Sparklineputs the newest sample at the right edge, so a short history grows leftward instead of sitting at the left edge. This applies to bar and popup graphs alike.create-a-widget.md,popups.mdandproviders.mddescribe the new behavior.Testing
BarEditingTests.testEmptyWidgetsHaveDistinctNamedPlaceholdersAndOutputDisplaySelectionWinsnow checks that a script widget whose layout is empty is off the bar, and that it returns once its script fails.swift test: everything passes except the 5ReleaseTestsunchangedAppRejects…cases, which fail on this Mac on plainmaintoo.workspaceWindowFocusUsesItsIDAndReportsFailurefailed once under full-suite load and passed in the other full run and in 3 runs on its own.scriptUpdatesInvalidateOnlyTheViewsTheyAffectwhen the empty check was in the bar's visibility. That led to moving it into the presentation.Offscreen renders (
--render-docs-imageswith a temporary scene): a script widget whose blocks all usehideWhenEmpty, the built-in system widget with two graph samples, and a clock.Not checked: the first CPU value on a live bar. The renders use sample output.
Merging
Rebase merge, so each fix keeps its own commit in the changelog.
Claude Opus 5.5 via Claude Code (T3 Code)