Open
Conversation
✅ Deploy Preview for tiddlywiki-previews ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Confirmed: pmario has already signed the Contributor License Agreement (see contributing.md) |
📊 Build Size Comparison:
|
| Branch | Size |
|---|---|
| Base (master) | 2487.2 KB |
| PR | 2488.5 KB |
Diff: ⬆️ Increase: +1.3 KB
⚠️ Change Note Status
This PR appears to contain code changes but doesn't include a change note.
Please add a change note by creating a .tid file in editions/tw5.com/tiddlers/releasenotes/<version>/
📚 Documentation: Release Notes and Changes
💡 Note: If this is a documentation-only change, you can ignore this message.
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.
PR: Add
validValuesattribute to button and reveal widgets (#6548)Problem
When a tab is removed but its state tiddler retains the stale identifier, no tab button appears selected and no tab body is revealed — the user sees a blank panel.
Solution
Both
<$button>and<$reveal>now accept avalidValuesattribute containing a filter expression. If the current state value is not in the evaluated results, the widget falls back todefault. Using a filter is essential becausetabsListis typically a filter like[tag[$:/tags/SideBar]].The tabs macro passes
validValues=<<__tabsList__>>to its button and reveal widgets automatically — no end-user changes needed.Additional fixes
isSelected()refactoring — The original nested ternary with||fallback madeisSelected()truthy for all buttons when usingsetTitle+setField/setIndexwith adefault. Now uses strictcurrentValue === this.setTo.changedTiddlers[this.setTitle]check sosetTitle-based buttons re-render on state changes.Files changed
core/modules/widgets/button.jsvalidValues, refactoredisSelected(), refresh fixcore/modules/widgets/reveal.jsvalidValuesfallback inreadState()core/wiki/macros/tabs.tidvalidValues=<<__tabsList__>>editions/tw5.com/.../ButtonWidget.tideditions/tw5.com/.../RevealWidget.tidTests (13 button + 1 tabs integration)
setsetsetsetsetsetsetsetTitlesetFieldsetIndexAll test cases use compound tiddlers, manually importable into a wiki for visual verification.
fixes: #6548