-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Flexbox story sidebar #9532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Flexbox story sidebar #9532
Conversation
✅ Deploy Preview for tiddlywiki-previews ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Confirmed: BurningTreeC has already signed the Contributor License Agreement (see contributing.md) |
📊 Build Size Comparison:
|
| Branch | Size |
|---|---|
| Base (master) | 2451.4 KB |
| PR | 2506.6 KB |
Diff: ⬆️ Increase: +55.2 KB
✅ Change Note Status
All change notes are properly formatted and validated!
📝 $:/changenotes/5.4.0/#9532
Type: enhancement | Category: usability
Release: 5.4.0
The sidebar moves out of view and into view
🔗 #9532
👥 Contributors: BurningTreeC
📖 Change Note Guidelines
Change notes help track and communicate changes effectively. See the full documentation for details.
|
I like it |
This change note details an enhancement to the sidebar behavior in version 5.4.0, allowing it to move smoothly when hiding and showing.
Refactor focus management for sidebar layout, ensuring focusable elements are correctly set and tab navigation is trapped within main content. Improved spacebar scrolling prevention and click refocusing behavior.
Refactor focus handler to manage secondary containers and update sidebar focus behavior.
Remove outline from secondary container on focus.
Removed unnecessary div wrapper from the story template.
Added a helper function to check for active text selection and updated focus handling logic to prevent refocusing when text is selected.
Add order styles for secondary container elements.
Updated focus handler module to improve focus management and scrolling functionality.
OverviewThis pull request introduces a modern flexbox-based layout system for TiddlyWiki5's story river and sidebar, replacing the traditional CSS positioning approach. The most visible change is that the sidebar now smoothly slides in and out of view using CSS transitions, providing a more polished and responsive user experience. Key Features1. Flexbox Layout ArchitectureThe PR restructures the
2. Animated Sidebar TransitionsThe sidebar now slides out of and into the viewport using CSS transitions rather than simply appearing/disappearing. This works in both layout modes:
3. New Infrastructure ComponentsFilter Tracker (
|
| Metric | Value |
|---|---|
| Files Changed | 25 |
| Lines Added | +1,607 |
| Lines Removed | −577 |
| Build Size Impact | +38.0 KB to empty.html |
New Tiddler Tags
| Tag | Description |
|---|---|
$:/tags/MediaQueryTracker |
Tag tiddlers with this to register them as media query trackers |
New Tiddler Fields
For media query tracker tiddlers:
| Field | Description |
|---|---|
media-query |
The CSS media query to evaluate (supports wikitext transclusions) |
info-tiddler |
The info tiddler to update with the result |
info-tiddler-alt |
Optional secondary info tiddler to update |
Compatibility
This is a significant change to TiddlyWiki's core layout system. While designed to be backward compatible with existing content, themes and plugins that heavily customize the page layout may require updates.
Status
This PR is currently in Draft status, submitted for discussion and feedback from the TiddlyWiki community.
|
To fix: indentation and unused variables |
| // The rest of the startup process here is not strictly to do with loading modules, but are needed before other startup | ||
| // modules are executed. It is easier to put them here than to introduce a new startup module | ||
| // -------------------------- | ||
| // Create a root widget for attaching event handlers. By using it as the parentWidget for another widget tree, one can reuse the event handlers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since TW ships JS comments with the source code. If we have multiline comments it usually looks like this. The dashes --- increase code size for no real win
/*
Multiline comments
*/
| wiki: $tw.wiki, | ||
| document: $tw.browser ? document : $tw.fakeDocument | ||
| }); | ||
| // Set up the performance framework |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the next 3 comments are redundant, since the function names eg: $tw.Performance() should speak for itself.
| var DropZoneWidget = function(parseTreeNode,options) { | ||
| this.initialise(parseTreeNode,options); | ||
| var DropZoneWidget = function(parseTreeNode, options) { | ||
| this.initialise(parseTreeNode, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think those extra spaces should not be there. If ESLint styling did this, we probably need to adjust the settings there
| \whitespace trim | ||
| \define lingo-base() $:/language/BottomToolbar/ | ||
| \procedure tooltip-lingo(suffix) {{{ [<lingo-base>addsuffix<suffix>get[text]] }}} | ||
| <nav class="tc-bottom-toolbar tc-secondary-container tc-secondary-container-bottom" role="navigation" aria-label=<<lingo Hint>>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the file should have proper indentation to make it human readable
| \function tf.story-river.tabindex() [{$:/info/mediaquery/min-width}match[no]then[]] :else[[-1]] | ||
| \whitespace trim | ||
| <section class="tc-story-river" role="main"> | ||
| <section class=<<tf.story-river.classes>> role="main" tabindex=<<tf.story-river.tabindex>>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tf. function name should only have 1 dot. imo for consistency reasons it should be tf.story-river-classes
| icon: $:/core/images/standard-layout | ||
| code-body: yes | ||
|
|
||
| \function tf.primary-container.classes() [{$:/info/mediaquery/min-width}match[no]then[tc-primary-container tc-inner-container-wrapper]] :else[[tc-inner-container-wrapper]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it plural or singular?
| infoTiddlerFields.push(getDarkModeTiddler()); | ||
| mqList.addListener(function(event) { | ||
| updateInfoTiddlersCallback([getDarkModeTiddler()]); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed without a replacement?
Jermolene
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @BurningTreeC the animation is helpful. It's a lot of code, much of which looks like it might be of wider utility. Are there other fixes or enhancements that could be built on top of the new design?
|
|
||
| .tc-page-controls button svg, .tc-tiddler-controls button svg, .tc-topbar button svg { | ||
| transition: fill 150ms ease-in-out; | ||
| transition: color 150ms ease-in-out; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this change is redundant for this PR. It should be in the PR that fixes #9521
| display: block; | ||
| margin-top: 1em; | ||
| margin-bottom: 1em; | ||
| margin-block-start: 1em; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
margin-block-* are 2020 baseline. IMO we don't need block properties ATM, since there isn't urgent need to support vertical writing mode in the core.
| white-space: pre-wrap; | ||
| padding: 0 3px 2px; | ||
| padding-block-start: 0; | ||
| padding-inline: 3px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
padding-inline is 2021 baseline. To support 2017 baseline, it's suggested to use the macros introduced in 9148
| border-left: 5px solid <<colour blockquote-bar>>; | ||
| margin-left: 25px; | ||
| padding-left: 10px; | ||
| border-inline-start: 5px solid <<colour blockquote-bar>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
border-inline-* properties are 2020 baseline. Fallbacks are required. And IMO bidirectional support for blockquotes are also redundant for this PR.
| top: -1000px; | ||
| left: -1000px; | ||
| inset-block-start: -1000px; | ||
| inset-inline-start: -1000px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inset-inline-* are 2021 baseline.
| /* Bottom Toolbar Base */ | ||
| .tc-bottom-toolbar { | ||
| position: fixed; | ||
| inset-inline: 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inset-inline is 2021 baseline.
| description: Items from $:/tags/TopLeftBar | ||
| caption: Legacy Top Left Bar | ||
| custom-menu-content: <$transclude tiddler="$:/plugins/tiddlywiki/menubar/items/topleftbar" mode="inline"/> | ||
| custom-menu-styles-wide: float: inline-start; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
float: inline-start is 2023 baseline. We may need to intergrate CSS feature query mechanism to filters.
|
I think it's better to split changes that enhance bidirectional support to another PR. Including too many changes for many aspects in one PR may make it troublesome for maintaining and testing. |

This PR makes the sidebar move out of the viewport with css transitions
It works in fluid-fixed and fixed-fluid mode
Bildschirmaufzeichnung.vom.2025-12-28.23-54-50.mp4
It uses flexbox on the
.tc-page-containerand the.tc-page-container > dropzoneAbove the dropzone the menubar gets transcluded so that the scrollbar of the story-river and sidebar don't get hidden below it
The pageScroller gets some adjustments so that it can scroll a scrollContainer and so that it accomodates for possible scroll-margins
There are also some adjustments for spacebar-scroll-trapping, too
Just to discuss it, maybe something finds its way into the core