dunlin/musing.md

95 lines
2.7 KiB
Markdown
Raw Normal View History

2022-12-23 19:45:58 +00:00
# Braindump
2022-12-19 18:19:13 +00:00
2022-12-23 19:45:58 +00:00
This is a combination of a thinking-out-loud document and a TODO list.
It is not a document of record. You should not expect to derive value
from reading it
2022-12-19 18:19:13 +00:00
2022-12-23 19:45:58 +00:00
tl;dr what if ... a web browser, but tabs were more like emacs buffers?
2022-12-19 18:19:13 +00:00
## objects/data types
buffer
Buffer.find ;; by name, title, url
Buffer.by_name (maybe?)
buffer has-a webview but it is not shown by default. Later we may
add some kind of webview reuse so that invisible and old buffers
don't need to have a webview until needed.
2022-12-23 19:45:58 +00:00
I seem to be using "buffer" and "tab" mostly synonymously
2022-12-19 18:19:13 +00:00
frame
Frame.the-frame
frame.set-buffer (buffer)
frame.get-buffer => buffer
frame.commander - text entry widget
frame.actions - container of toolbar buttons
2022-12-23 19:45:58 +00:00
in future we may be able to split a frame into multiple windows
which show different buffers
2022-12-19 18:19:13 +00:00
location (url)
document
document element(?)
webview
lua's standard types
2023-01-01 00:15:26 +00:00
-----
2022-12-23 19:45:58 +00:00
2023-01-01 00:15:26 +00:00
a consideration we haven't touched on yet: in emacs, not all buffers
are files - e.g. the buffer list, or the process list, or the magit
status buffer - there is a well-used affordance for elisp to put
semi-persistent interactable content onscreen - do we need such a
thing here or is it ok to say "just call gtk" to command authors
2022-12-26 11:31:35 +00:00
2023-01-01 00:15:26 +00:00
----
2022-12-26 11:31:35 +00:00
2023-01-01 00:15:26 +00:00
when input widget is active for a parameter, show the completions
flowbox
2022-12-26 11:31:35 +00:00
2023-01-01 00:15:26 +00:00
while typing, use the typed input to get a completions list. each
completion is an acceptable value: convert to a gtk widget by calling
(to-label value) and add to flowbox.
2022-12-26 11:31:35 +00:00
2023-01-01 00:15:26 +00:00
if the value is a table
if :to-label key present, use it as-is
else Gtk.Label { :label value.value }
else (assume it's a string)
Gtk.Label { :label value }
2022-12-26 11:31:35 +00:00
2023-01-01 00:15:26 +00:00
on RET, check there is a completion value whose stringification
matches the input string. Hide the flowbox
2022-12-26 11:31:35 +00:00
2023-01-01 00:15:26 +00:00
to activate a rendered completion, the callback needs to perform the
same action as RET would on the chosen value
2022-12-26 11:31:35 +00:00
2023-01-01 00:15:26 +00:00
is there a role for TAB?
- in the shell it activates completion or shows options: we don't need that if we're updating them automatically
2022-12-26 11:31:35 +00:00
2023-01-01 00:15:26 +00:00
- we could use it to cycle through the available completions: switch
focus from entry to step through the completions then RET activates
2022-12-26 11:31:35 +00:00
2023-01-01 00:15:26 +00:00
-----
# TODO
2022-12-26 11:31:35 +00:00
2023-01-01 00:15:26 +00:00
* [done] show loading progress
* [done] show url when the commander is inactive
* [done] visit-location url defaults to current
* custom rendering for completions (e.g. buffer thumbnails)
* buffer name is often going to be useless. find buffers
by url/title
still need some 1:1 mapping between the buffer object and
a text-representable form of same
* click in commander widget activates visit-location
* display unbound key error
* ESC to cancel interactive command
* autocomplete command name
* multiple buffers
- create buffer
- list buffers (do we need this if we have thumbnails?)