-
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
Draft
BurningTreeC
wants to merge
87
commits into
TiddlyWiki:master
Choose a base branch
from
BurningTreeC:flexbox-story-sidebar
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Flexbox story sidebar #9532
Changes from 18 commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
788003f
Create focus-handler.js
BurningTreeC 0655630
add functionality
BurningTreeC ad97de8
remove flex.tid
BurningTreeC 7cedc8c
make sidebar slide out
BurningTreeC 04f6a32
make it work for fixed-fluid
BurningTreeC f4c3496
no changed order in rtl
BurningTreeC 0449b7d
reduce padding-top of story-river
BurningTreeC f052b2d
also scroll-margin-left
BurningTreeC 9c32080
Refactor focus-handler.js for consistency
BurningTreeC bc2106e
Refactor focus-handler.js for consistent spacing
BurningTreeC fb00b69
Fix string quotes in getBounds function
BurningTreeC d5513ba
Add change note for sidebar movement enhancement
BurningTreeC b43d26c
Update flexbox-story-sidebar.tid in release notes
BurningTreeC ec14a79
Refactor focus handling and prevent spacebar scrolling
BurningTreeC ddf6062
Update focus handler for sidebar and secondary containers
BurningTreeC 0852590
Update sidebar class for secondary container
BurningTreeC 9c188d8
Change menubar class to secondary container
BurningTreeC d39a142
Remove outline from secondary container
BurningTreeC f558c5f
Refactor focus-handler for iframe and selector updates
BurningTreeC 75427e6
Refactor PageTemplate by removing div wrapper
BurningTreeC 62c2b3e
Enhance focus handling with text selection check
BurningTreeC ce7df68
Update menubar class for improved styling
BurningTreeC 7ee54ae
Define order for secondary container positions
BurningTreeC 32b06fd
Refactor focus-handler module for sidebar layout
BurningTreeC a6a527a
Fix sidebar HTML structure
BurningTreeC e21ec97
Implement focusWithSelection to preserve text selection
BurningTreeC 284c481
Prevent focus stealing from sidebar-search
BurningTreeC 766ef2d
Prevent focus stealing from sidebar-search
BurningTreeC 5ba4c9f
Refactor focus handling for interactive elements
BurningTreeC 94b3e13
Modify section class in PageTemplate story
BurningTreeC e912813
Enhance isInteractiveElement function for accuracy
BurningTreeC 96b2dd7
Adjust padding in base.tid file
BurningTreeC bb66a37
Refactor page container styles in base.tid
BurningTreeC f0c453e
Implement responsive styles for dropzone
BurningTreeC 68063ee
Update styles.tid
BurningTreeC e2779b2
Update base.tid
BurningTreeC 4712ea9
Update base.tid
BurningTreeC 4cb84e2
Update styles.tid
BurningTreeC ac1462e
Update styles.tid
BurningTreeC 4c5b669
Update story.tid
BurningTreeC daf6f72
Update story.tid
BurningTreeC ab8037f
Update PageTemplate.tid
BurningTreeC 469b93c
Update menu.tid
BurningTreeC 1e8f31b
Update dropzone.js to add tabindex attribute to domNode
BurningTreeC fa2fc08
Update base.tid
BurningTreeC 5b45b1f
Update base.tid
BurningTreeC 6227bfa
Update base.tid
BurningTreeC 2b9f838
Update base.tid
BurningTreeC d1e74d5
Update toprightbar.tid
BurningTreeC 1122153
Update topleftbar.tid
BurningTreeC e5e3f68
Update base.tid
BurningTreeC 33f0a14
Update styles.tid
BurningTreeC 759d915
Update base.tid with logical css properties
BurningTreeC 6220203
Update base.tid with logical css
BurningTreeC 85124e3
more logical css properties
BurningTreeC 2695629
update menubar styles with logical css properties
BurningTreeC 81a2c04
fix 2 missing semicolons in snowwhite stylesheet and animate "color" …
BurningTreeC bcff1b7
add scroll-margins to tc-tiddler-frame
BurningTreeC cf34eaf
add some popup clamps
BurningTreeC fe435b7
fix padding-block-start of tc-sidebar-scrollable
BurningTreeC f8bccd9
fix dropzone not catching imports
BurningTreeC 1177d7c
update dropzone widget
BurningTreeC 6bb9068
Update startup.js
BurningTreeC b617ea9
Update load-modules.js
BurningTreeC ba06506
Update platform.js
BurningTreeC ff30566
Create mediaquerytracker.js
BurningTreeC ae2fb0b
Create filter-tracker.js
BurningTreeC bc0966a
Create background-actions.js
BurningTreeC dec2a90
Rename core/modules/mediaquerytracker.js to core/modules/info/mediaqu…
BurningTreeC 5f5b9aa
Create MinWidth.tid
BurningTreeC a3ba6e6
Update PageTemplate.tid
BurningTreeC 72d7960
Update story.tid
BurningTreeC fb56dc2
Update mediaquerytracker.js
BurningTreeC 7a16901
Update filter-tracker.js
BurningTreeC 7bf6d54
Merge branch 'TiddlyWiki:master' into flexbox-story-sidebar
BurningTreeC cd20b61
Create BottomToolbar.multids
BurningTreeC 8e527e5
Create bottom-toolbar.tid
BurningTreeC 873cb2c
Create bottom-toolbar.tid
BurningTreeC 11e65fb
Update bottom-toolbar.tid
BurningTreeC bf6331e
Update bottom-toolbar.tid
BurningTreeC ec0ea1a
Update bottom-toolbar.tid
BurningTreeC 493dfe1
Update bottom-toolbar.tid
BurningTreeC a517c9a
Update focus-handler.js
BurningTreeC 816fd5b
Update base.tid
BurningTreeC 98d100d
Update dropzone.js
BurningTreeC c1b706d
Update PageTemplate.tid
BurningTreeC 0ecddfc
Update bottom-toolbar.tid
BurningTreeC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| /*\ | ||
| title: $:/plugins/custom/sidebar-focus/startup.js | ||
| type: application/javascript | ||
| module-type: startup | ||
| Handles focus management and spacebar scrolling for sidebar layout | ||
| \*/ | ||
| "use strict"; | ||
|
|
||
| exports.name = "sidebar-focus"; | ||
| exports.platforms = ["browser"]; | ||
| exports.after = ["story"]; | ||
BurningTreeC marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| exports.synchronous = true; | ||
|
|
||
| exports.startup = function() { | ||
| var mainSelector = ".tc-story-river"; | ||
| var secondarySelector = ".tc-secondary-container"; | ||
|
|
||
| // Helper: Check if element is in any secondary container | ||
| function isInSecondary(element) { | ||
| var containers = document.querySelectorAll(secondarySelector); | ||
| return Array.from(containers).some(function(container) { | ||
| return container === element || container.contains(element); | ||
| }); | ||
| } | ||
|
|
||
| // Wait for DOM to be fully ready | ||
| function initialize() { | ||
| var main = document.querySelector(mainSelector); | ||
|
|
||
| if(!main) { | ||
| setTimeout(initialize, 100); | ||
BurningTreeC marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return; | ||
| } | ||
|
|
||
| // Make main focusable | ||
| if(!main.hasAttribute("tabindex")) { | ||
| main.setAttribute("tabindex", "-1"); | ||
| } | ||
| main.focus(); | ||
|
|
||
| // Make secondary containers unfocusable | ||
| var secondaryContainers = document.querySelectorAll(secondarySelector); | ||
| secondaryContainers.forEach(function(element) { | ||
| element.removeAttribute("tabindex"); | ||
| }); | ||
| } | ||
|
|
||
| // Handle spacebar scrolling in secondary containers | ||
| document.addEventListener("keydown", function(e) { | ||
| if(e.key !== " ") return; | ||
|
|
||
| if(isInSecondary(e.target)) { | ||
| // Allow spacebar in input fields | ||
| if(e.target.tagName === "INPUT" || | ||
| e.target.tagName === "TEXTAREA" || | ||
| e.target.isContentEditable) { | ||
| return; | ||
| } | ||
| e.preventDefault(); | ||
| } | ||
| }, true); | ||
|
|
||
| // Tab-Trapping: Keep tab navigation within main content | ||
| document.addEventListener("keydown", function(e) { | ||
| if(e.key !== "Tab") return; | ||
|
|
||
| var main = document.querySelector(mainSelector); | ||
| if(!main) return; | ||
|
|
||
| var focusableElements = main.querySelectorAll( | ||
| 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])' | ||
| ); | ||
|
|
||
| if(focusableElements.length === 0) { | ||
| e.preventDefault(); | ||
| main.focus(); | ||
| return; | ||
| } | ||
|
|
||
| var firstElement = focusableElements[0]; | ||
| var lastElement = focusableElements[focusableElements.length - 1]; | ||
| var activeElement = document.activeElement; | ||
|
|
||
| // Only trap if we're in main | ||
| var inMain = activeElement === main || main.contains(activeElement); | ||
| if(!inMain) { | ||
| e.preventDefault(); | ||
| main.focus(); | ||
| return; | ||
| } | ||
|
|
||
| // Trap tab at boundaries | ||
| if(e.shiftKey && activeElement === firstElement) { | ||
| e.preventDefault(); | ||
| lastElement.focus(); | ||
| } else if(!e.shiftKey && activeElement === lastElement) { | ||
| e.preventDefault(); | ||
| firstElement.focus(); | ||
| } else if(activeElement === main) { | ||
| e.preventDefault(); | ||
| firstElement.focus(); | ||
| } | ||
| }); | ||
|
|
||
| // Click-Handler: Always refocus main after clicks (except in input fields) | ||
| document.addEventListener("click", function(e) { | ||
| var main = document.querySelector(mainSelector); | ||
| if(!main) return; | ||
|
|
||
| // Don't refocus if clicking in input fields | ||
| if(e.target.tagName === "INPUT" || | ||
| e.target.tagName === "TEXTAREA" || | ||
| e.target.isContentEditable) { | ||
| return; | ||
| } | ||
|
|
||
| setTimeout(function() { | ||
| main.focus(); | ||
| }, 10); | ||
| }, true); | ||
|
|
||
| initialize(); | ||
| }; | ||
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
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
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
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
13 changes: 13 additions & 0 deletions
13
editions/tw5.com/tiddlers/releasenotes/5.4.0/#9532 - flexbox-story-sidebar.tid
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| title: $:/changenotes/5.4.0/#9532 | ||
| created: 20251229082625621 | ||
| modified: 20251229082625621 | ||
| tags: $:/tags/ChangeNote | ||
| change-type: enhancement | ||
| change-category: usability | ||
| description: The sidebar moves out of view and into view | ||
| release: 5.4.0 | ||
| github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9532 | ||
| github-contributors: BurningTreeC | ||
| type: text/vnd.tiddlywiki | ||
|
|
||
| This pull request makes the sidebar move when hiding and showing, rather than jumping. |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.