Skip to content

Commit 70ce416

Browse files
committed
WindowTools 1.5.1
1 parent bfa5c30 commit 70ce416

File tree

5 files changed

+147
-104
lines changed

5 files changed

+147
-104
lines changed

jgclark.WindowTools/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ _Please see the [Plugin documentation](https://noteplan.co/plugins/jgclark.Windo
33

44
<!-- - TODO: Extend to deal with closed main sidebars.
55
- TODO: Can now save a folder as part of a window set. (Note: not yet a particular 'folder view'.) -->
6+
## [1.5.1] - 2026-03-06
7+
- dev: under-the-hood changes to deal with changes in NP's window handling:
8+
- ignores new class of invisible HTMLWindows (well, as far as the API is accurate)
9+
- allows for editor[0] not to exist, and adds messages about folder views.
610

711
## [1.5.0] - 2025-11-30
812
- **open note in new window** and **open current note in new window** now don't just open the new 'floating' window wherever NP decides, which is often unhelpful. Instead it tries to place it next to, _but not on top of_, existing NP windows. You can turn off this behaviour using the new '

jgclark.WindowTools/plugin.json

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"plugin.author": "Jonathan Clark",
99
"plugin.url": "https://github.com/NotePlan/plugins/blob/main/jgclark.WindowTools/README.md",
1010
"plugin.changelog": "https://github.com/NotePlan/plugins/blob/main/jgclark.WindowTools/CHANGELOG.md",
11-
"plugin.version": "1.5.0",
11+
"plugin.version": "1.5.1",
1212
"plugin.releaseStatus": "full",
13-
"plugin.lastUpdateInfo": "v1.5.0: Use 'smart placement' when opening new Editor windows in the commands. New setting 'Use Smart Placement?' allows you to turn off this behaviour.\nv1.4.0: New '/reset windows' command.\nNow can save folders andsidebar width in Window Sets, and open to that width (requires NP v3.19.2).\nOther improvements to Window Sets.\nv1.3.0: Improve note and heading pickers. Support for Teamspace notes in /open note... commands. Fix to Window Set selection.\nv1.2.1: update list of plugin windows it knows about\nv1.2.0: new command 'swap splits', plus positioning bug fix\nv1.1.2: Bug fixes.\nv1.1.1: improve migration from previous plugin ('WindowSets')\nv1.1.0: added x-callbacks for /open Window Set, /open note in new split and /open note in new window commands.\nv1.0.0: 3 new commands, and renamed plugin from 'Window Sets'. Also moved 3 window-related commands from 'Note Helpers' plugin.\nv0.4.0: First public release, and requires NP v3.9.8.",
13+
"plugin.lastUpdateInfo": "v1.5.1: under-the-hood changes to deal with changes in NP's window handling.\nv1.5.0: Use 'smart placement' when opening new Editor windows in the commands. New setting 'Use Smart Placement?' allows you to turn off this behaviour.\nv1.4.0: New '/reset windows' command.\nNow can save folders andsidebar width in Window Sets, and open to that width (requires NP v3.19.2).\nOther improvements to Window Sets.",
1414
"plugin.dependencies": [],
1515
"plugin.script": "script.js",
1616
"plugin.isRemote": "false",
@@ -116,8 +116,39 @@
116116
"description": "Delete a saved set of windows/panes",
117117
"jsFunction": "deleteWindowSet"
118118
},
119+
{
120+
"name": "onEditorWillSave",
121+
"hidden": true,
122+
"description": "Trigger entry point to sync WS note to local WS preference",
123+
"jsFunction": "onEditorWillSave"
124+
},
125+
{
126+
"name": "log current windows list",
127+
"alias": [
128+
"lwl"
129+
],
130+
"description": "Log list of currently-open windows/panes",
131+
"jsFunction": "logWindowsList"
132+
},
133+
{
134+
"name": "test: log preference",
135+
"alias": [
136+
"lp"
137+
],
138+
"description": "Log local preference",
139+
"jsFunction": "logPreferenceAskUser"
140+
},
141+
{
142+
"name": "test: unset preference",
143+
"alias": [
144+
"up"
145+
],
146+
"description": "Unset local preference",
147+
"jsFunction": "unsetPreferenceAskUser"
148+
},
119149
{
120150
"name": "test: write window set note to pref",
151+
"hidden": true,
121152
"alias": [
122153
"wnp"
123154
],
@@ -126,18 +157,13 @@
126157
},
127158
{
128159
"name": "test: write window set pref to note",
160+
"hidden": true,
129161
"alias": [
130162
"wpn"
131163
],
132164
"description": "Write WS local preference to note",
133165
"jsFunction": "writeWSsToNote"
134166
},
135-
{
136-
"name": "onEditorWillSave",
137-
"hidden": true,
138-
"description": "Trigger entry point to sync WS note to local WS preference",
139-
"jsFunction": "onEditorWillSave"
140-
},
141167
{
142168
"name": "test: log current window sets",
143169
"alias": [
@@ -146,16 +172,9 @@
146172
"description": "Log my available windows sets",
147173
"jsFunction": "logWindowSets"
148174
},
149-
{
150-
"name": "test: log current windows list",
151-
"alias": [
152-
"lwl"
153-
],
154-
"description": "Log list of currently-open windows/panes",
155-
"jsFunction": "logWindowsList"
156-
},
157175
{
158176
"name": "test: set editor width",
177+
"hidden": true,
159178
"alias": [
160179
"sew"
161180
],
@@ -164,32 +183,13 @@
164183
},
165184
{
166185
"name": "test: delete all saved Window Sets",
186+
"hidden": true,
167187
"description": "Delete all saved window sets",
168188
"jsFunction": "deleteAllSavedWindowSets"
169189
},
170-
{
171-
"name": "test: log preference",
172-
"alias": [
173-
"lp"
174-
],
175-
"description": "Log local preference",
176-
"jsFunction": "logPreferenceAskUser"
177-
},
178-
{
179-
"name": "test: unset preference",
180-
"alias": [
181-
"up"
182-
],
183-
"description": "Unset local preference",
184-
"jsFunction": "unsetPreferenceAskUser"
185-
},
186-
{
187-
"name": "test: updatePlugin",
188-
"description": "Test migration to newer name",
189-
"jsFunction": "testUpdate"
190-
},
191190
{
192191
"name": "test: log sidebar width",
192+
"hidden": true,
193193
"description": "Log the current sidebar width (requires NP v3.19.2 or later)",
194194
"alias": [
195195
"lsbw"
@@ -198,6 +198,7 @@
198198
},
199199
{
200200
"name": "test: set sidebar width",
201+
"hidden": true,
201202
"description": "Set the sidebar width (requires NP v3.19.2 or later)",
202203
"alias": [
203204
"ssbw"
@@ -209,6 +210,7 @@
209210
},
210211
{
211212
"name": "test: toggle sidebar",
213+
"hidden": true,
212214
"description": "Toggle the sidebar (requires NP v3.19.2 or later)",
213215
"alias": [
214216
"tsb"
@@ -217,6 +219,7 @@
217219
},
218220
{
219221
"name": "test: open sidebar",
222+
"hidden": true,
220223
"description": "Open the sidebar (requires NP v3.19.2 or later)",
221224
"alias": [
222225
"osb"
@@ -225,6 +228,7 @@
225228
},
226229
{
227230
"name": "test: close sidebar",
231+
"hidden": true,
228232
"description": "Close the sidebar (requires NP v3.19.2 or later)",
229233
"alias": [
230234
"csb"

jgclark.WindowTools/src/WTHelpers.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//---------------------------------------------------------------
33
// Helper functions for WindowTools plugin
44
// Jonathan Clark
5-
// last update 2025-11-30 for v1.5.0 by @jgclark
5+
// last update 2026-03-06 for v1.5.1 by @jgclark
66
//---------------------------------------------------------------
77

88
import pluginJson from '../plugin.json'
@@ -43,6 +43,11 @@ export const pluginWindowsAndCommands: Array<PluginWindowCommand> = [
4343
{ pluginWindowId: 'jgclark.Dashboard.main', pluginID: 'jgclark.Dashboard', pluginCommandName: 'Show Dashboard' },
4444
{ pluginWindowId: 'jgclark.Reviews.rich-review-list', pluginID: 'jgclark.Reviews', pluginCommandName: 'project lists' },
4545
{ pluginWindowId: 'jgclark.Summaries.heatmap', pluginID: 'jgclark.Summaries', pluginCommandName: 'heatmap for task completion' },
46+
{ pluginWindowId: 'jgclark.Summaries.chartSummaryStats', pluginID: 'jgclark.Summaries', pluginCommandName: 'chart progress summary' },
47+
{ pluginWindowId: 'form-browser-window main', pluginID: 'dwertheimer.forms', pluginCommandName: 'Sidebar Browser' },
48+
{ pluginWindowId: 'dwertheimer.Forms Form Builder React Window Service Form', pluginID: 'dwertheimer.forms', pluginCommandName: 'Form Builder/Editor' },
49+
{ pluginWindowId: 'main:emetzger.LinearCalendar:Linear Calendar', pluginID: 'emetzger.LinearCalendar', pluginCommandName: 'showLinearCalendar' },
50+
{ pluginWindowId: 'main:emetzger.Calendar:Calendar', pluginID: 'emetzger.Calendar', pluginCommandName: 'showCalendar' },
4651
]
4752

4853
// Data types
@@ -61,6 +66,7 @@ export type EditorWinDetails = {
6166
height: number,
6267
}
6368

69+
// The HTMLWinDetails type is used to store the details of a single HTML window. Note: this is different from HTMLView from the API.
6470
export type HTMLWinDetails = {
6571
type: string, // "Plugin" is the only type supported so far
6672
pluginID: string,

jgclark.WindowTools/src/index.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ export async function onSettingsUpdated(): Promise<void> {
8080
return // Placeholder only to try to stop error in logs
8181
}
8282

83-
export async function testUpdate(): Promise<void> {
84-
await onUpdateOrInstall(true)
85-
return
86-
}
87-
8883
export async function onUpdateOrInstall(testUpdate: boolean = false): Promise<void> {
8984
try {
9085
logInfo(pluginID, `onUpdateOrInstall ...`)

0 commit comments

Comments
 (0)