···67676868## Design patterns
69697070-- Escape IZUI
7171- * IZUI: inverse zooming user interface
7272- * ZUIs navigate by starting from a known root and user navigates by zooming ever further in
7373- * Escape starts anywhere, and instead of navigating by zooming in, all interfaces can zoom out to reset
7474- * allows unbounded and diverse entry points with predictable behavior
7575- * consistent path to familiar ground
7070+Escape IZUI
7171+* IZUI: inverse zooming user interface
7272+* ZUIs navigate by starting from a known root and user navigates by zooming ever further in
7373+* Escape starts anywhere, and instead of navigating by zooming in, all interfaces can zoom out to reset
7474+* allows unbounded and diverse entry points with predictable behavior
7575+* consistent path to familiar ground
76767777Escape navigation model
7878- * navigation base can start at any level in stack
7979- * forward navigations are added on top of stack
8080- * backwards navigations walk the stack in reverse
7878+* navigation base can start at any level in stack
7979+* forward navigations are added on top of stack
8080+* backwards navigations walk the stack in reverse
81818282## Architecture / Implementation
83838484-Peek is designed to be modular and configurable around the idea that parts of it can run in different environments.
8484+Peek is designed to be modular and configurable around the idea that parts of it
8585+can run in different environments.
85868687For example:
8788- Definitely planning on a mobile app which syncs and runs your peeks/slides/scripts
8889- I'd like to have a decentralized compute option for running your scripts outside of your clients and syncing the data
8990- Want cloud storage for all config and data, esp infinite history, so can do fun things with it
90919292+### "features" == privileged web apps
9393+9494+The core features are web apps loaded over a custom protocol:
9595+- currently with a scheme of `peek`
9696+- access to a few special apis noted in the next section
9797+9898+### Peek API
9999+100100+Initially the prototype was all Electron. But that's not interesting, and doesn't
101101+really tell us anything about constraints of the web itself.
102102+103103+So instead I asked this question: What's the minimum capability set that a web app would
104104+need to build the features I need?
105105+106106+The answer, so far, is giving `peek` apps the following APIs:
107107+108108+- window open/close
109109+- global hotkey registration
110110+- pubsub messaging
111111+112112+Custom window api might be able to away entirely, by passing window.open features, working on that.
113113+91114### Desktop App
9211593116Proof of concept is Electron. By far the best option today for cross-platform desktop apps which need a web rendering engine. There's really nothing else remotely suited (yet).
941179595-The user interface is just Tweakpane panels and modal chromeless web pages rn.
118118+User interface:
119119+- the built-in features are all modal chromeless web pages at this point
120120+- settings "apps" are [lil-gui](https://github.com/georgealways/lil-gui) panels
9612197122TODO
98123- Need to look at whether could library-ize some of what Agregore implemented for non-HTTP protocol support.
···119144120145## Papercut / use-case log
121146147147+core
148148+- open a web page on top/bottom/left/right
149149+- keep web pages persistent in the background
150150+- quickly open a web page modally, and close it
151151+122152- open bandcamp in a window, move over to 2nd display, accidently close it while moving around between other windows
123153- recent books or recipes from newsletters i subscribe to (but probably didn't read)
124154- extract a table from a page periodically, send it somewhere as csv or whatever (chained actions)
···127157- be able to see where a book/etc recommendation came from
128158- save a tweet, with URL / image / relevant text, but not whole page webrecorder style
129159160160+Content scripts
161161+- extract+log shazams
162162+- extract+log spotify playlist
163163+164164+Workflow deconstructing a "why" task flavour of bookmarking
165165+- save https://www.criterionchannel.com/hong-kong-in-new-york
166166+- extract the movies
167167+- get reference metadata for each (?!)
168168+- add to "to watch list", with pointer back to source url
169169+130170## Roadmap
131171132132-## v0.1 - MVP (minimum viable preview)
172172+## v0.1 - MVPOC
173173+174174+minimum viable proof of concept.
175175+176176+question: would i use this?
133177134178Core moduluarization
135179- [x] Modularize feature types, eyeing the extensibility model
···174218- [x] basic command bar to open pages
175219- [x] fix setting layout wrapping issue
176220177177-Core blockers
178178-- [ ] built-in feature loading from origin not file
179179-- [ ] combine settings and background in built-in features?
180180-181221Commands/messaging
182222- [x] implement pubsub api
183223- [x] way to tell feature to open default ui (if there is one)
184224- [x] way tell feature to open its settings ui (if there is one)
185225186186-Install/load/address features
187187-- [ ] app protocol? webextension? pwa? wtf?
188188-- [ ] pull from manifest (load/install via manifest with special key?)
189189-- [ ] manifests for feature metadata
190190-- [ ] feature urls? eg peek://settings(/index.html)
191191-- [ ] feature metadata in manifest
192192-- [ ] move feature bg pages to iframes in core bg page?
193193-194194-Feature un/install and reloads
195195-- [x] feature unload/reload - init/uninit whole feature and window
196196-- [ ] all api calls have feature id accessible by preload (via manifest?)
197197-- [ ] unreg shortcuts on unload
198198- - confirm sucessful reg
199199- - send pubsub msgs on shortcut reg/unreg with feature id
200200- - in core/bg, listen for regs and map to feature
201201- - then on feature uninstall, unreg
202202-- [ ] close other windows, not just background (track all feature wins? hierarchy? window manager?)
203203-- [ ] figure out re-init/reload story when pref/feature change is saved
204204- - can leave to the apps? eg document.reload()? likely not for OS level stuff
205205- - could do a storage change listener, but all kinds of reasons why you *wouldn't* do full reload...
206206- - preload could register window + thing (eg kb listener) and listen for feature-disable events
207207- - ok so basically do at api level
208208-- [ ] language: call them feature or apps? other?
209209-- [ ] core settings re-render on feature toggle
210210-211211-Daily driver blockers
212212-- [x] debug vs profile(s) for app dir
213213-- [ ] actually load/unload peeks when enabled/disabled
214214-- [ ] actually load/unload slides when enabled/disabled
215215-- [ ] actually load/unload scripts when enabled/disabled
216216-- [ ] fix ESC not working right
217217-- [ ] fix ESC not working in web content
218218-- [ ] make it so start feature can be unset
219219-220220-Focus vs not focused app mode
221221-- [ ] openWindow option to not close on escape (perma windows w/ controls)
222222-- [ ] app focus detection in shortcuts
223223-- [ ] separate global shortcuts from app shortcuts (eg quit)
224224-- [ ] all-window show/hide when doing global shortcuts while app unfocused
225225-226226Features cleanup
227227- [x] enable/disable individual slides, peeks
228228- [x] enable/disable individual scripts
···232232- [x] fix label names, match to pwa manifest
233233- [x] put readable log labels back in
234234235235-Dev niceties
236236-- [ ] figure out single devtools window if possible
235235+## v0.2 - MVCP (minimum viable concept preview)
237236238238-Window controls/persistence/etc (after perma window)
239239-- [ ] window position persistence where it makes sense (settings, groups, cmd) and make configurable?
240240-- [ ] window size persistence where it makes sense (slides, peeks) and make configurable?
241241-- [ ] window controls
242242-- [ ] window resizers
237237+minimum viable concept preview.
243238244244-Window animations
245245-- [ ] add window open animation (to/from coords, time) to openWindow
246246-- [ ] update slides impl to use animation again
239239+question: would others use this?
247240248248-Window transparency
249249-- [ ] add support to api
250250-- [ ] update core settings to use it
251251-- [ ] update app settings to use it
241241+Windows/system
242242+- [x] app showing in dock even tho disabled
243243+- [x] app not showing in tray, even tho enabled
244244+- [x] all api calls get source attached
245245+- [x] window cache s/custom/map/
246246+- [x] window cache all windows not just persistent
247247+- [x] window cache - evaluate key approach (use-case: apps need to identify windows they open)
248248+- [x] always return window id, so apps can manage it
249249+- [x] reimplement keys, so much easier for callers than managing ids
250250+- [x] account for number of renderer processes (seems double?)
251251+252252+redo window system to be more webby
253253+- [x] prototype window.open
254254+- [x] evaluate webContents.setWindowOpenHandler
255255+- [x] stop using openWindow to show pre-existing hidden windows?
256256+ - [x] can track web windows locally
257257+ - [x] can identify web windows on both sides (key/name)
258258+ - [x] add new custom api for windows superpowers
259259+- [x] collapse window opening to span both approaches
260260+- [x] finish converting all openWindow to window.open
261261+262262+Feature lifecycle (un/install and reloads)
263263+- [x] feature unload/reload - init/uninit whole feature and window
264264+- [x] all api calls have address accessible by preload
265265+- [x] close other windows of feature, not just background window
266266+267267+Feature re-init/reload when toggled
268268+- [x] main: track shortcuts by source, remove when unloaded
269269+- [x] main: track window sources
270270+- [x] main: close child windows when (before) closing source window
271271+272272+Shortcut lifecycle
273273+- [x] main process should handle multiple registrations correctly
274274+- [x] send/track feature id/origin w/ each registration
275275+- [x] unreg shortcuts on unload
276276+277277+Window features
278278+- [ ] add back in window features to window.open
279279+ - [x] show/hide (keep alive)
280280+ - [x] transparent
281281+- [ ] enable global window resize
282282+- [ ] add draggable as pref
283283+284284+Features clean themselves up for lifecycle events
285285+- [ ] determine if new web-native windowing approach resolves this
286286+- [ ] load/unload peeks when enabled/disabled
287287+- [ ] load/unload slides when enabled/disabled
288288+- [ ] load/unload scripts when enabled/disabled
289289+290290+Peeks/Slides
291291+- [x] only register shortcut and create window if a URL is configured
292292+- [ ] unreg shortcuts and close windows on peek un/configure
293293+- [ ] unreg shortcuts and close windows on slides un/configure
294294+295295+Cmd
296296+- [x] fix it
297297+- [ ] app-scoped multi-window pages open
298298+299299+Settings
300300+- [x] fix window size
301301+- [x] transparency
302302+- [ ] core settings re-render on feature toggle, eg feature-settings link enabled
303303+- [ ] default position (size to screen)
304304+305305+Daily driver blockers
306306+- [x] debug vs profile(s) for app dir
307307+- [x] fix ESC not working right
308308+- [x] fix ESC not working in web content
309309+- [x] fix ESC not working right over lil-gui
310310+311311+Dev stuff
312312+- [x] figure out single devtools window if possible
252313253314Deployment
254315- [ ] app updates
255316- [ ] icons
256317- [ ] about page
257318319319+Demo scenario
320320+- [ ] Peeks: translate, calendar, ai chat, currency conversion, everytimezone, tldraw
321321+- [ ] Slides: soundcloud, crypto prices, notepad, todo list
322322+- [ ] Scripts: eth price, weather change
323323+258324### v0.2 - extensibility / remember shit
259325326326+Backburner wishlist
327327+- [ ] window switching order algo
328328+329329+DX papercuts
330330+- [ ] why crashing on reload main
331331+- [ ] devtools stealing focus
332332+- [ ] unified floating devtools
333333+334334+Window features
335335+- [x] add transparency support to api
336336+- [ ] distentangle transparency and content-fit
337337+- [ ] add the rest of that shit
338338+339339+App mgmt
340340+- [ ] uniform policy for feature id creation (lean on web/extensions)
341341+- [ ] collisions
342342+343343+App dev
344344+- [ ] app model - web? extension? P/IWA? other?
345345+- [ ] shared libs, eg utils
346346+- [ ] language: call them feature or apps? other?
347347+348348+Focus vs not focused app mode
349349+- [ ] openWindow option to not close on escape (perma windows w/ controls)
350350+- [ ] app focus detection in shortcuts
351351+- [ ] separate global shortcuts from app shortcuts (eg quit)
352352+- [ ] all-window show/hide when doing global shortcuts while app unfocused
353353+354354+Install/load/address features
355355+- [x] built-in feature loading from origin not file
356356+- [x] app protocol? webextension? pwa? wtf?
357357+- [ ] combine settings and background in built-in features?
358358+ - eg, features can have default ui + bg services?
359359+- [ ] pull from manifest (load/install via manifest with special key?)
360360+- [ ] manifests for feature metadata
361361+- [ ] feature urls? eg peek://settings(/index.html)
362362+- [ ] feature metadata in manifest
363363+- [ ] move feature bg pages to iframes in core bg page?
364364+365365+Settings
366366+- [ ] make it so start feature can be unset (eh)
367367+260368Navigation
261369- [ ] make izui stack manager (part of window mgr?)
262370- [ ] esc stack: from feature settings back to core settings
263371- [ ] add to izui stack (and ix w/ history?)
372372+373373+Window animations
374374+- [ ] add window open animation (to/from coords, time) to openWindow
375375+- [ ] update slides impl to use animation again
376376+377377+Window controls/persistence/etc (after perma window)
378378+- [ ] window position persistence where it makes sense (settings, groups, cmd) and make configurable?
379379+- [ ] window size persistence where it makes sense (slides, peeks) and make configurable?
380380+- [ ] window controls
381381+- [ ] window resizers
264382265383History
266384- [ ] push navigations out through pubsub?