Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
788003f
Create focus-handler.js
BurningTreeC Dec 28, 2025
0655630
add functionality
BurningTreeC Dec 28, 2025
ad97de8
remove flex.tid
BurningTreeC Dec 28, 2025
7cedc8c
make sidebar slide out
BurningTreeC Dec 28, 2025
04f6a32
make it work for fixed-fluid
BurningTreeC Dec 28, 2025
f4c3496
no changed order in rtl
BurningTreeC Dec 28, 2025
0449b7d
reduce padding-top of story-river
BurningTreeC Dec 28, 2025
f052b2d
also scroll-margin-left
BurningTreeC Dec 28, 2025
9c32080
Refactor focus-handler.js for consistency
BurningTreeC Dec 29, 2025
bc2106e
Refactor focus-handler.js for consistent spacing
BurningTreeC Dec 29, 2025
fb00b69
Fix string quotes in getBounds function
BurningTreeC Dec 29, 2025
d5513ba
Add change note for sidebar movement enhancement
BurningTreeC Dec 29, 2025
b43d26c
Update flexbox-story-sidebar.tid in release notes
BurningTreeC Dec 29, 2025
ec14a79
Refactor focus handling and prevent spacebar scrolling
BurningTreeC Dec 29, 2025
ddf6062
Update focus handler for sidebar and secondary containers
BurningTreeC Dec 29, 2025
0852590
Update sidebar class for secondary container
BurningTreeC Dec 29, 2025
9c188d8
Change menubar class to secondary container
BurningTreeC Dec 29, 2025
d39a142
Remove outline from secondary container
BurningTreeC Dec 29, 2025
f558c5f
Refactor focus-handler for iframe and selector updates
BurningTreeC Dec 29, 2025
75427e6
Refactor PageTemplate by removing div wrapper
BurningTreeC Dec 29, 2025
62c2b3e
Enhance focus handling with text selection check
BurningTreeC Dec 29, 2025
ce7df68
Update menubar class for improved styling
BurningTreeC Dec 29, 2025
7ee54ae
Define order for secondary container positions
BurningTreeC Dec 29, 2025
32b06fd
Refactor focus-handler module for sidebar layout
BurningTreeC Dec 29, 2025
a6a527a
Fix sidebar HTML structure
BurningTreeC Dec 29, 2025
e21ec97
Implement focusWithSelection to preserve text selection
BurningTreeC Dec 29, 2025
284c481
Prevent focus stealing from sidebar-search
BurningTreeC Dec 29, 2025
766ef2d
Prevent focus stealing from sidebar-search
BurningTreeC Dec 29, 2025
5ba4c9f
Refactor focus handling for interactive elements
BurningTreeC Dec 29, 2025
94b3e13
Modify section class in PageTemplate story
BurningTreeC Dec 29, 2025
e912813
Enhance isInteractiveElement function for accuracy
BurningTreeC Dec 29, 2025
96b2dd7
Adjust padding in base.tid file
BurningTreeC Dec 29, 2025
bb66a37
Refactor page container styles in base.tid
BurningTreeC Dec 29, 2025
f0c453e
Implement responsive styles for dropzone
BurningTreeC Dec 29, 2025
68063ee
Update styles.tid
BurningTreeC Dec 29, 2025
e2779b2
Update base.tid
BurningTreeC Dec 29, 2025
4712ea9
Update base.tid
BurningTreeC Dec 29, 2025
4cb84e2
Update styles.tid
BurningTreeC Dec 29, 2025
ac1462e
Update styles.tid
BurningTreeC Dec 29, 2025
4c5b669
Update story.tid
BurningTreeC Dec 29, 2025
daf6f72
Update story.tid
BurningTreeC Dec 29, 2025
ab8037f
Update PageTemplate.tid
BurningTreeC Dec 29, 2025
469b93c
Update menu.tid
BurningTreeC Dec 29, 2025
1e8f31b
Update dropzone.js to add tabindex attribute to domNode
BurningTreeC Dec 29, 2025
fa2fc08
Update base.tid
BurningTreeC Dec 29, 2025
5b45b1f
Update base.tid
BurningTreeC Dec 29, 2025
6227bfa
Update base.tid
BurningTreeC Dec 29, 2025
2b9f838
Update base.tid
BurningTreeC Dec 29, 2025
d1e74d5
Update toprightbar.tid
BurningTreeC Dec 29, 2025
1122153
Update topleftbar.tid
BurningTreeC Dec 29, 2025
e5e3f68
Update base.tid
BurningTreeC Dec 29, 2025
33f0a14
Update styles.tid
BurningTreeC Dec 29, 2025
759d915
Update base.tid with logical css properties
BurningTreeC Dec 29, 2025
6220203
Update base.tid with logical css
BurningTreeC Dec 29, 2025
85124e3
more logical css properties
BurningTreeC Dec 29, 2025
2695629
update menubar styles with logical css properties
BurningTreeC Dec 29, 2025
81a2c04
fix 2 missing semicolons in snowwhite stylesheet and animate "color" …
BurningTreeC Dec 29, 2025
bcff1b7
add scroll-margins to tc-tiddler-frame
BurningTreeC Dec 29, 2025
cf34eaf
add some popup clamps
BurningTreeC Dec 29, 2025
fe435b7
fix padding-block-start of tc-sidebar-scrollable
BurningTreeC Dec 29, 2025
f8bccd9
fix dropzone not catching imports
BurningTreeC Dec 29, 2025
1177d7c
update dropzone widget
BurningTreeC Dec 29, 2025
6bb9068
Update startup.js
BurningTreeC Dec 30, 2025
b617ea9
Update load-modules.js
BurningTreeC Dec 30, 2025
ba06506
Update platform.js
BurningTreeC Dec 30, 2025
ff30566
Create mediaquerytracker.js
BurningTreeC Dec 30, 2025
ae2fb0b
Create filter-tracker.js
BurningTreeC Dec 30, 2025
bc0966a
Create background-actions.js
BurningTreeC Dec 30, 2025
dec2a90
Rename core/modules/mediaquerytracker.js to core/modules/info/mediaqu…
BurningTreeC Dec 30, 2025
5f5b9aa
Create MinWidth.tid
BurningTreeC Dec 30, 2025
a3ba6e6
Update PageTemplate.tid
BurningTreeC Dec 30, 2025
72d7960
Update story.tid
BurningTreeC Dec 30, 2025
fb56dc2
Update mediaquerytracker.js
BurningTreeC Dec 30, 2025
7a16901
Update filter-tracker.js
BurningTreeC Dec 30, 2025
7bf6d54
Merge branch 'TiddlyWiki:master' into flexbox-story-sidebar
BurningTreeC Dec 30, 2025
cd20b61
Create BottomToolbar.multids
BurningTreeC Dec 30, 2025
8e527e5
Create bottom-toolbar.tid
BurningTreeC Dec 30, 2025
873cb2c
Create bottom-toolbar.tid
BurningTreeC Dec 30, 2025
11e65fb
Update bottom-toolbar.tid
BurningTreeC Dec 30, 2025
bf6331e
Update bottom-toolbar.tid
BurningTreeC Dec 30, 2025
ec0ea1a
Update bottom-toolbar.tid
BurningTreeC Dec 30, 2025
493dfe1
Update bottom-toolbar.tid
BurningTreeC Dec 30, 2025
a517c9a
Update focus-handler.js
BurningTreeC Dec 30, 2025
816fd5b
Update base.tid
BurningTreeC Dec 30, 2025
98d100d
Update dropzone.js
BurningTreeC Dec 30, 2025
c1b706d
Update PageTemplate.tid
BurningTreeC Dec 30, 2025
0ecddfc
Update bottom-toolbar.tid
BurningTreeC Dec 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions core/language/en-GB/BottomToolbar.multids
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
title: $:/language/BottomToolbar/

Hint: Bottom toolbar
Back/Caption: Back
Back/Hint: Go back
Home/Caption: Home
Home/Hint: Go to start
New/Caption: New
New/Hint: Create new tiddler
Search/Caption: Search
Search/Hint: Open search
Menu/Caption: Menu
Menu/Hint: Toggle sidebar
116 changes: 116 additions & 0 deletions core/modules/background-actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/*\
title: $:/core/modules/background-actions.js
type: application/javascript
module-type: global

Class to dispatch actions when filters change

\*/

"use strict";

class BackgroundActionDispatcher {
constructor(filterTracker, wiki) {
this.filterTracker = filterTracker;
this.wiki = wiki;
this.nextTrackedFilterId = 1;
this.trackedFilters = new Map(); // Use Map for better key management
// Track the filter for the background actions
this.filterTracker.track({
filterString: "[all[tiddlers+shadows]tag[$:/tags/BackgroundAction]!is[draft]]",
fnEnter: title => this.trackFilter(title),
fnLeave: (title, enterValue) => this.untrackFilter(enterValue),
fnChange: (title, enterValue) => {
this.untrackFilter(enterValue);
return this.trackFilter(title);
},
fnProcess: changes => this.process(changes)
});
}

trackFilter(title) {
const tiddler = this.wiki.getTiddler(title);
const id = this.nextTrackedFilterId++;
const tracker = new BackgroundActionTracker({
wiki: this.wiki,
title,
trackFilter: tiddler.fields["track-filter"],
actions: tiddler.fields.text
});
this.trackedFilters.set(id, tracker);
return id;
}

untrackFilter(enterValue) {
const tracker = this.trackedFilters.get(enterValue);
if(tracker) {
tracker.destroy();
}
this.trackedFilters.delete(enterValue);
}

process(changes) {
for(const tracker of this.trackedFilters.values()) {
tracker.process(changes);
}
}
}

/*
Represents an individual tracked filter. Options include:
wiki: wiki to use
title: title of the tiddler being tracked
trackFilter: filter string to track changes
actions: actions to be executed when the filter changes
*/
class BackgroundActionTracker {
constructor({wiki, title, trackFilter, actions}) {
this.wiki = wiki;
this.title = title;
this.trackFilter = trackFilter;
this.actions = actions;
this.filterTracker = new $tw.FilterTracker(this.wiki);
this.hasChanged = false;
this.trackerID = this.filterTracker.track({
filterString: this.trackFilter,
fnEnter: () => { this.hasChanged = true; },
fnLeave: () => { this.hasChanged = true; },
fnProcess: changes => {

Check warning on line 78 in core/modules/background-actions.js

View workflow job for this annotation

GitHub Actions / eslint

[ESLint PR code] reported by reviewdog 🐶 'changes' is defined but never used. Raw Output: {"ruleId":"no-unused-vars","severity":1,"message":"'changes' is defined but never used.","line":78,"column":15,"nodeType":"Identifier","messageId":"unusedVar","endLine":78,"endColumn":22,"suggestions":[{"messageId":"removeVar","data":{"varName":"changes"},"fix":{"range":[2146,2153],"text":"()"},"desc":"Remove unused variable 'changes'."}]}
if(this.hasChanged) {
this.hasChanged = false;
console.log("Processing background action", this.title);
const tiddler = this.wiki.getTiddler(this.title);
let doActions = true;
if(tiddler && tiddler.fields.platforms) {
doActions = false;
const platforms = $tw.utils.parseStringArray(tiddler.fields.platforms);
if(($tw.browser && platforms.includes("browser")) || ($tw.node && platforms.includes("node"))) {
doActions = true;
}
}
if(doActions) {
this.wiki.invokeActionString(
this.actions,
null,
{
currentTiddler: this.title
},{
parentWidget: $tw.rootWidget
}
);
}
}
}
});
}

process(changes) {
this.filterTracker.handleChangeEvent(changes);
}

destroy() {
this.filterTracker.untrack(this.trackerID);
}
}

exports.BackgroundActionDispatcher = BackgroundActionDispatcher;
106 changes: 106 additions & 0 deletions core/modules/filter-tracker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*\
title: $:/core/modules/filter-tracker.js
type: application/javascript
module-type: global

Class to track the results of a filter string

\*/

"use strict";

class FilterTracker {
constructor(wiki) {
this.wiki = wiki;
this.trackers = new Map();
this.nextTrackerId = 1;
}

handleChangeEvent(changes) {
this.processTrackers();
this.processChanges(changes);
}

/*
Add a tracker to the filter tracker. Returns null if any of the parameters are invalid, or a tracker id if the tracker was added successfully. Options include:
filterString: the filter string to track
fnEnter: function to call when a title enters the filter results. Called even if the tiddler does not actually exist. Called as (title), and should return a truthy value that is stored in the tracker as the "enterValue"
fnLeave: function to call when a title leaves the filter results. Called as (title,enterValue)
fnChange: function to call when a tiddler changes in the filter results. Only called for filter results that identify a tiddler or shadow tiddler. Called as (title,enterValue), and may optionally return a replacement enterValue
fnProcess: function to call each time the tracker is processed, after any enter, leave or change functions are called. Called as (changes)
*/
track(options = {}) {
const {

Check failure on line 33 in core/modules/filter-tracker.js

View workflow job for this annotation

GitHub Actions / eslint

[ESLint PR code] reported by reviewdog 🐶 Unexpected space(s) after "const". Raw Output: {"ruleId":"@stylistic/keyword-spacing","severity":2,"message":"Unexpected space(s) after \"const\".","line":33,"column":8,"nodeType":null,"messageId":"unexpectedAfter","endLine":33,"endColumn":9,"fix":{"range":[1303,1304],"text":""}}
filterString,
fnEnter,
fnLeave,
fnChange,
fnProcess
} = options;
const id = this.nextTrackerId++;
const tracker = {
id,
filterString,
fnEnter,
fnLeave,
fnChange,
fnProcess,
previousResults: [],
resultValues: {}
};
this.trackers.set(id, tracker);
// Process the tracker
this.processTracker(id);
return id;
}

untrack(id) {
this.trackers.delete(id);
}

processTrackers() {
for(const id of this.trackers.keys()) {
this.processTracker(id);
}
}

processTracker(id) {
const tracker = this.trackers.get(id);
if(!tracker) return;
const results = [];
// Evaluate the filter and remove duplicate results
$tw.utils.each(this.wiki.filterTiddlers(tracker.filterString), title => {
$tw.utils.pushTop(results, title);
});
// Process the newly entered results
results.forEach(title => {
if(!tracker.previousResults.includes(title) && !tracker.resultValues[title] && tracker.fnEnter) {
tracker.resultValues[title] = tracker.fnEnter(title) || true;
}
});
// Process the results that have just left
tracker.previousResults.forEach(title => {
if(!results.includes(title) && tracker.resultValues[title] && tracker.fnLeave) {
tracker.fnLeave(title, tracker.resultValues[title]);
delete tracker.resultValues[title];
}
});
// Update the previous results
tracker.previousResults = results;
}

processChanges(changes) {
for(const tracker of this.trackers.values()) {
Object.keys(changes).forEach(title => {
if(title && tracker.previousResults.includes(title) && tracker.fnChange) {
tracker.resultValues[title] = tracker.fnChange(title, tracker.resultValues[title]) || tracker.resultValues[title];
}
});
if(tracker.fnProcess) {
tracker.fnProcess(changes);
}
}
}
}

exports.FilterTracker = FilterTracker;
72 changes: 72 additions & 0 deletions core/modules/info/mediaquerytracker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*\
title: $:/core/modules/info/mediaquerytracker.js
type: application/javascript
module-type: info

Initialise $:/info/ tiddlers derived from media queries via

\*/

"use strict";

exports.getInfoTiddlerFields = function(updateInfoTiddlersCallback) {
if($tw.browser) {
// Functions to start and stop tracking a particular media query tracker tiddler
function track(title) {
var result = {},

Check failure on line 16 in core/modules/info/mediaquerytracker.js

View workflow job for this annotation

GitHub Actions / eslint

[ESLint PR code] reported by reviewdog 🐶 Expected indentation of 3 tabs but found 4 spaces. Raw Output: {"ruleId":"@stylistic/indent","severity":2,"message":"Expected indentation of 3 tabs but found 4 spaces.","line":16,"column":1,"nodeType":"Keyword","messageId":"wrongIndentation","endLine":16,"endColumn":7,"fix":{"range":[381,387],"text":"\t\t\t"}}
tiddler = $tw.wiki.getTiddler(title);

Check failure on line 17 in core/modules/info/mediaquerytracker.js

View workflow job for this annotation

GitHub Actions / eslint

[ESLint PR code] reported by reviewdog 🐶 Expected indentation of 4 tabs but found 8 spaces. Raw Output: {"ruleId":"@stylistic/indent","severity":2,"message":"Expected indentation of 4 tabs but found 8 spaces.","line":17,"column":1,"nodeType":"Identifier","messageId":"wrongIndentation","endLine":17,"endColumn":11,"fix":{"range":[404,414],"text":"\t\t\t\t"}}
if(tiddler) {

Check failure on line 18 in core/modules/info/mediaquerytracker.js

View workflow job for this annotation

GitHub Actions / eslint

[ESLint PR code] reported by reviewdog 🐶 Expected indentation of 3 tabs but found 4 spaces. Raw Output: {"ruleId":"@stylistic/indent","severity":2,"message":"Expected indentation of 3 tabs but found 4 spaces.","line":18,"column":1,"nodeType":"Keyword","messageId":"wrongIndentation","endLine":18,"endColumn":7,"fix":{"range":[452,458],"text":"\t\t\t"}}
var mediaQueryRaw = tiddler.fields["media-query"],

Check failure on line 19 in core/modules/info/mediaquerytracker.js

View workflow job for this annotation

GitHub Actions / eslint

[ESLint PR code] reported by reviewdog 🐶 Expected indentation of 4 tabs but found 8 spaces. Raw Output: {"ruleId":"@stylistic/indent","severity":2,"message":"Expected indentation of 4 tabs but found 8 spaces.","line":19,"column":1,"nodeType":"Keyword","messageId":"wrongIndentation","endLine":19,"endColumn":11,"fix":{"range":[472,482],"text":"\t\t\t\t"}}
infoTiddler = tiddler.fields["info-tiddler"],

Check failure on line 20 in core/modules/info/mediaquerytracker.js

View workflow job for this annotation

GitHub Actions / eslint

[ESLint PR code] reported by reviewdog 🐶 Expected indentation of 5 tabs but found 12 spaces. Raw Output: {"ruleId":"@stylistic/indent","severity":2,"message":"Expected indentation of 5 tabs but found 12 spaces.","line":20,"column":1,"nodeType":"Identifier","messageId":"wrongIndentation","endLine":20,"endColumn":15,"fix":{"range":[533,547],"text":"\t\t\t\t\t"}}
infoTiddlerAlt = tiddler.fields["info-tiddler-alt"];

Check failure on line 21 in core/modules/info/mediaquerytracker.js

View workflow job for this annotation

GitHub Actions / eslint

[ESLint PR code] reported by reviewdog 🐶 Expected indentation of 5 tabs but found 12 spaces. Raw Output: {"ruleId":"@stylistic/indent","severity":2,"message":"Expected indentation of 5 tabs but found 12 spaces.","line":21,"column":1,"nodeType":"Identifier","messageId":"wrongIndentation","endLine":21,"endColumn":15,"fix":{"range":[593,607],"text":"\t\t\t\t\t"}}
var parser = $tw.wiki.parseText("text/vnd.tiddlywiki", mediaQueryRaw, {parseAsInline: true});

Check failure on line 22 in core/modules/info/mediaquerytracker.js

View workflow job for this annotation

GitHub Actions / eslint

[ESLint PR code] reported by reviewdog 🐶 Expected indentation of 4 tabs but found 3. Raw Output: {"ruleId":"@stylistic/indent","severity":2,"message":"Expected indentation of 4 tabs but found 3.","line":22,"column":1,"nodeType":"Keyword","messageId":"wrongIndentation","endLine":22,"endColumn":4,"fix":{"range":[660,663],"text":"\t\t\t\t"}}
var widgetNode = $tw.wiki.makeWidget(parser, {parentWidget: $tw.rootWidget});

Check failure on line 23 in core/modules/info/mediaquerytracker.js

View workflow job for this annotation

GitHub Actions / eslint

[ESLint PR code] reported by reviewdog 🐶 Expected indentation of 4 tabs but found 3. Raw Output: {"ruleId":"@stylistic/indent","severity":2,"message":"Expected indentation of 4 tabs but found 3.","line":23,"column":1,"nodeType":"Keyword","messageId":"wrongIndentation","endLine":23,"endColumn":4,"fix":{"range":[757,760],"text":"\t\t\t\t"}}
var container = $tw.fakeDocument.createElement("div");
widgetNode.render(container, null);
var mediaQuery = container.textContent.trim();
if(mediaQuery && infoTiddler) {
// Evaluate and track the media query
result.mqList = window.matchMedia(mediaQuery);
function getResultTiddlers() {
var value = result.mqList.matches ? "yes" : "no",
tiddlers = [];
tiddlers.push({title: infoTiddler, text: value});
if(infoTiddlerAlt) {
tiddlers.push({title: infoTiddlerAlt, text: value})
}
return tiddlers;
};
updateInfoTiddlersCallback(getResultTiddlers());
result.handler = function(event) {

Check warning on line 40 in core/modules/info/mediaquerytracker.js

View workflow job for this annotation

GitHub Actions / eslint

[ESLint PR code] reported by reviewdog 🐶 'event' is defined but never used. Raw Output: {"ruleId":"no-unused-vars","severity":1,"message":"'event' is defined but never used.","line":40,"column":41,"nodeType":"Identifier","messageId":"unusedVar","endLine":40,"endColumn":46,"suggestions":[{"messageId":"removeVar","data":{"varName":"event"},"fix":{"range":[1646,1651],"text":""},"desc":"Remove unused variable 'event'."}]}
updateInfoTiddlersCallback(getResultTiddlers());
};
result.mqList.addEventListener("change",result.handler);
}
}
return result;
}
function untrack(enterValue) {
if(enterValue.mqList && enterValue.handler) {
enterValue.mqList.removeEventListener("change",enterValue.handler);
}
}
// Track media query tracker tiddlers
function fnEnter(title) {
return track(title);
}
function fnLeave(title,enterValue) {
untrack(enterValue);
}
function fnChange(title,enterValue) {
untrack(enterValue);
return track(title);
}
$tw.filterTracker.track({
filterString: "[all[tiddlers+shadows]tag[$:/tags/MediaQueryTracker]!is[draft]]",
fnEnter: fnEnter,
fnLeave: fnLeave,
fnChange: fnChange
});
}
return [];
};
7 changes: 0 additions & 7 deletions core/modules/info/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ exports.getInfoTiddlerFields = function(updateInfoTiddlersCallback) {
// Screen size
infoTiddlerFields.push({title: "$:/info/browser/screen/width", text: window.screen.width.toString()});
infoTiddlerFields.push({title: "$:/info/browser/screen/height", text: window.screen.height.toString()});
// Dark mode through event listener on MediaQueryList
var mqList = window.matchMedia("(prefers-color-scheme: dark)"),
getDarkModeTiddler = function() {return {title: "$:/info/darkmode", text: mqList.matches ? "yes" : "no"};};
infoTiddlerFields.push(getDarkModeTiddler());
mqList.addListener(function(event) {
updateInfoTiddlersCallback([getDarkModeTiddler()]);
});
Copy link
Member

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?

// Language
infoTiddlerFields.push({title: "$:/info/browser/language", text: navigator.language || ""});
}
Expand Down
Loading
Loading