Skip to content

Latest commit

 

History

History
549 lines (495 loc) · 25.8 KB

backlog.org

File metadata and controls

549 lines (495 loc) · 25.8 KB

inbox (for triage)

bug with wrapping on big screen: (+*:)^:(<15)~ 0.3

further improve render__app by omitting the cursor moves for adjacent characters

general purpose hbox/vbox widgets

general purpose grid widget

  • for macro debugger
  • for keymap editing
  • for file browser? (tree-grid)

[#A] fix blank line in history

from outliner:

  • tab to go to repl
  • press up
  • you should see the previous line from history
  • instead you see a blank line

[#A] multi-line macros are broken because of this line in jprez.ijs

 set__hist__repl__BASE'' NB. so delete it. (TODO: handle multi-line macros)

bug: pressing n at end of last slide takes you to top of last slide

it should just do nothing.

allow binding keys to multi-character macros

NB. TODO: ‘d$’ is the “correct” vim macro for kc_k/macro ‘K’

group syntax to record a macro

(abcd) would execute a,b,c,d in 4 ticks

block syntax to run a macro at max speed

[abcd] would execute a,b,c,d in 1 tick
  • for typing long strings at speed
  • for grouping primitive operations into a single “command”

give blocks a name

:go[abcd]  would define 'go'
{go} would call 'go' (??)
  • there needs to be an end delimiter because

character to invoke a named macro

  • right now, every macro instruction is a single character
  • therefore, many ascii characters are used up.
  • so: we need an escape character to indicate that we want to call a macro, rather than execute each character in its name.
  • we also need an end-escape character to indicate the end of the name.

lines in the screenplay that are too long are unreadable.

“what good is the nub sieve?”

[#C] tokenize org-mode text

need actual outlining capabilities

  • insert headline (actually works but requires save/reload)
  • re-indenting is not possible without external editor

reopen verb should refresh the outline widgets

adding line on blank slide breaks jprez

i have a last slide with one blank line i try to edit the line, and get this:

|index error: stop
|   L__cmds=:(<B__led)    C__cmds}L__cmds
|stop[3]

recent

stream-24 : unblocking mummy-nub

24a fix jrepl so non-nouns are displayed

verb “((V i. V) = i. $ V) # V” is not displaying correctly it seems to only show results when they’re nouns. had to also account for empty lines and comments.

24b fix starting point for history in macro player

“we do need to define V” is not starting the macro from the right place sometimes it works, sometimes it doesn’t seems like the behavior depends on which lines i’ve visited last with the outline cursor

[#A] general ability to re-arrange panels

everyone’s screen/camera setup will be different, so let them arrange the screen in the most convenient way. (especially for my own situation, i wanted the text to be on top for the recording, so that my eyes would line up with the camera while i was reading)

24c move “splitter” between outlines and presentation

24d button to toggle split screen vs full repl

utf-8 in the input displays incorrectly

APL characters are not being rendered and screwing up

make red same width as repl when toggling editor

keep cursor focused when playing

accomplished by using f9/f10 keys in addition to n/shift-N

add a callback from line editor when macro finishes playing

this is so i can advance the outline cursor after playmacro

stream-25 : mandelbrot blockers / j-kvm speed

[#B] hide errors containing do_WORLDnn_

stream-26 : macro debugger

[#A] macro debugger / stepper

you record a long macro and made a typo or want to change the timing now you’re editing macros by hand. this is annoying. also you have to remember what all the keys do, so it would be nice to see the macros vertically with a description for each keypress, and strings on their own line

stream-27 : ??

backlog

– asciicast support –

clear-screen support in worlds

make ehist a range? add estart variable to world?

macro line for clearing the screen

sets estart to current ehistlen

generate asciicast file

  • [ ] macro lines become input events
  • [ ] editor events need ansi output
  • [ ] single line version of screen diff escape code generator
  • [ ] input lines become “enter” keypress events

– left side editor –

[#A] horizontal scrolling doesn’t seem to work correctly with ^e, etc

make sure leftmost cursor is always in view

[#A] ability to insert linefeed/break lines

this is ^j in vim

[#C] would be nice to just have “org-mode” view

  • single editor buffer with the asterisks visible

[#B] ui to set initial state of editor for slide

This feature has always existed, by using source blocks in the outline. But there is no way to create such a thing in jprez. So the feature here is to edit the inital editor state without recording a macro. (meaning the viewer should not have to watch every character get typed out) Ex: we want to show complete settle code before we derive it.

[#B] let repl push input to the editor

  • maybe any assignment or load/import goes to the editor buffer by default?

[#B] store lsed state (visible, buffer, cursor) in each world

— keyboard event handlers –

[#A] arrow keys to navigate the outliner

add keyboard handling to use the editor

[#A] key: ^s should save anywhere (global hotkeys)..

right now you have to be focused on the outline could be done by having a globalkeys namespace that all keyboard handlers can coinsert

[#A] home key to move to start of line

[#A] end key to move to end of line

[#A] stop macro during playback

important because it can take a long time while you’re using jprez also you don’t want other keys to fire the macro or it’ll screw up

  • plan: use different keybindings when A=1

(use whatever “modal” dispatch system i use for app keyboard focus)

  • then we can have other keys when it’s play mode, rather than having it interpret our keypresses

[#B] alt-d to delete next word

[#B] alt-backspace to delete previous word

[#A] allow wrapping long output lines

this would be an option for the behavior of puts_vid (when writing to video buffer)

it looks like they wrap, but jrepl doesn’t know that they’ve wrapped, and puts the cursor in weird places. 3 issues:

  • 1. the lines don’t currently get cut off in the (default) non-wrapping mode
  • 2. when the lines wrap, jrepl doesn’t know that there multiple lines, and shows the cursor in wrong place.
  • 3. when editing a line long enough to overflow, it wraps back to the left side.

[#A] start in repl mode

[#C] support the escape codes to toggle wrapping

this would be added to the parser in vputs_vid

– later –

[#A] make it easier to recover a working terminal if there’s a bug in jprez/jkvm apps

extend ‘reset’ so that:

  • make sure echo is on
  • make sure cursor is on
  • if possible, make sure j’s readline gets re-enabled so j prompt has cursor control

(right now, you try to debug and you waste brain cycles trying to see the cursor, etc.) maybe even better would be a global error trap that does this in kvm_loop

[#A] add special pop-up editor for multi-widget macros.

(something that gave you more of fine-grained control over the timeline without having to edit macro code) almost like a timeline view? or like an old-school midi/mod tracker? ex ui: https://upload.wikimedia.org/wikipedia/commons/7/7e/Schism-beyond.gif

[#A] clean up the whole focus/keybinding mess

  • one option might be to dynamically copy all the verbs from the focused widget into the keybinding namespace

(clear it out and do that every time the focus changes)

  • to simply make the namespace in which i look for key handlers dynamic in j-kvm
  • set to the app when using ui/app
  • the app can do some of the keyboard dispatch
  • maybe this means coming up standard numbers for keyboard codes
  • gives us the ability to decouple the ui framework from vt-100

[#A] optimize output of render/blit

app: emit color codes only when they change

app: emit only changed cells

check for runs of same fg,bg colors

etc

a =: 8 32 $ a.i.’.’ b =: 95 (0 3;3 24; 3 26; 4 18)}a (draw =: [: puts cls, a.{~ ]) draw b

NB. row;cols table for differences: rct =: ((];”0{)I.@(a:&:)) <@I. a~:b

NB. individual coordinate pairs suitable for passing to { xys =: ;/;(,”0&.>/)”1 rct xys,.<”0 xys { b

NB. each row is x,y,val ;@|.”1(;”0~{&b) xys

redraw the changes:

generate list of attributes of the changed cells. ideally you’d have rank 2 list: fg and bg. turn it into 2 boxes.

anywhere the color changes from box to box, you issue a color change, otherwise ”.

likewise, for the coordinates, if they’re right next to each other, you don’t need to issue a cursor move

[#A] use numeric prefix for multi-commands

especially important for pauses

[#A] set base tempo for playback (in kps)

[#A] general undo system for all widgets

[#B] pick a new default panic/break key

maybe ^/ or ^] or whatever because ^space is used in emacs to set the mark (enter selection mode)

[#B] ctrl-space should enter selection mode

[#B] command to insert a line from repl into the editor at cursor

[#B] command to evaluate the editor in the repl

  • probably don’t want to dump the whole buffer
  • maybe say ‘<<evaluated x lines…>>’ in the repl

[#B] draw selection

[#B] ^c should not break out of the application

[#B] cut, copy, paste

requires a selection

[#B] make worlds optional

Some people will just prefer a regular repl.

[#B] speed up the escape code parsers (vputs, onkey)

[#B] extract UiComponent from UiApp (component=widget+container) (??)

have a list of children and auto-provide the ability to draw all of them with extra code. (probably can factor this out of ui/app.ijs)

[#B] app: define applications’ widget in a table with x,y,class,args

[#B] in the repl, if i print out a non-noun, syntax highlight it.

[#B] make vputs_vid_ table-driven

the current code is a horrifying recursive descent parser derive the state machine from a list of the escape code patterns

[#B] [5/12] have vputs_vid_ recognize escape codes

https://www2.ccs.neu.edu/research/gpc/VonaUtils/vona/terminal/vtansi.htm

home/goxy: CSI (row? ; col?)? H

erase screen: CSI 2J

clear to eol: CSI K

show cursor: CSI ?25 h

hide cursor: CSI ?25 l

vt code: cursor shift: CSI count? A|B|C|D # A=up B=dn C=rt D=lf

erase down: CSI J

bold: ( CSI 1m ? or is that just “bright”?)

italic?

enable line wrap: CSI 7h

disable line wrap: CSI 7l

query cursor position: CSI 6n (responds with CSI ROW;COL R)

‘0123456789’ e.~ s=:’1234;1234234x42342’

[#B] add real on_focus handlers

(after i do real keyboard focus handling solution)

[#B] check for multiline input. (direct defs)

  • we already have depth_world_ and we just need to check depth of last token
  • double check that parens cannot span lines inside direct definitions

[#B] visual indication that the file actually saved when you press ^s

status line widget? (right now we define a key and its macro logging character in one area, far away from the update method)

[#B] default tab-key handler (kc_i) should be to call ‘next-widget’ on main app

  • requires somehow having reference to the app in which we are running

[#B] render_UiApp_ (and compound widgets) should clear R flag on each widget it renders

[#B] look for kc_spc instead of k_nul

  • k_nul works, but it should probably be named kc_spc
  • (maybe this is vt100 thing?) actual ascii character is called ^@
  • double check that control-space actually sends ascii 0.

[#C] remove vtcolor_tok_ call from worlds

  • right now, exec calls vtcolor to color the history
  • maybe the repl widget itself should just know to color history lines
  • then we don’t need vtcolor (which actually stores escape characters in the history)

[#C] on accept: remove consecutive duplicates from history

  • maybe: if B != as last line in history, add it to the history
  • maybe: if last two items in history are same, delete one

[#C] re-arrange mje.ijs so that open” isn’t in the middle of the file

[#C] fix j-kvm on osx

[#C] test that the macro actually produces the next line of code in the script.

examples: manually edited macros might break. using “future” completion history is not allowed.

[#C] detect and “bake” usage of “future command line history”

this when you have a full future history from loading a presentation, and you use that history to complete a line in the past. This makes no sense from a narrative point of view.

[#C] show world for line, with content

on screen, show the world number as you move the outline cursor also have a display of the variables in scope that changes as you move the cursor

[#C] fix loop_kvm so left argument does not need to be in the z locale

[#C] decide whether curs 0 should be part of loop_kvm_, and if so, how to use cursors?

maybe this is just a flag.

[#C] allow setting vim or emacs keys

[#C] add word-wrap mode to list control

  • not just wrapping the characters, but breaking on spaces or hyphens or something
  • would need to track the height of each entry

[#C] file browser widget

[#C] “goal stack” widget in timeline

is this even different from a list widget? color coding, maybe? the goal is different: it’s to show the current state of the narrative. (it’s an “on-screen”, in-presentation widget that changes as you navigate through time)

[#C] demonstrate mouse events

[#C] elastic tabstops for editor

https://nickgravgaard.com/elastic-tabstops/

[#D] add ability to run arbitrary verbs on every frame

  • The idea here was to have a general-purpose task runner, that was not necessarily tied to a widget.
  • I don’t remember why I wanted this,
  • But it’s easy to simulate with an invisible widget.
  • Is there any need for more than this?

[#D] document and port cwio

cwio = ‘colorwrite’ https://github.com/tangentstorm/xpl/blob/master/demo/cwio_eg.pas

[#D] git status widget

(after we have a file browser)

[#D] paging in text editor

  • insert page
  • delete page
  • join pages

[#D] render_UiListWidget_ could use some golfing

someday / maybe

[#D] show (os) console in jqt

jshowconsole_j_ 1  NB. doesn't seem to work in jqt

qt terminal doesn’t support vt escape codes not sure i even care about this. (would have to be done in jqt front-end itself) (better idea would probably be make terminal emulator in jqt, or opengl, or SDL)

[#D] integrate with JOD?

design work needed

in exec_world_, decide what to do when an error happens and the debugger is on.

better idiom for expresssing ‘method___self’ (see create in repl.ijs)

maybe this ties in with the ‘::’ concept for nested spaces (but: conames and names don’t currently occupy the same namespace) maybe ::x is x in current namespace?

finished

[3/3] app framework

render multiple widgets to buffer

emit only changed lines

handle unicode vid buffers properly

[5/5] basic line editor

fix broken fwd/bwd commands

syntax highlighting in the editor (proof of concept)

fix bug: space key does not work

record keystrokes as macros

concatenate the inserted characters without redundant escapes

remove spurious color codes

move macros from token editor to plain editor

set aside “token editor” concept for now

restore syntax highlighting

[4/4] macro timing

record and quantize keystroke timestamps

encode timing in the macros itself

[7/7] make macro animations asynchronous

(get them out of the while loop)

  • [X] each widget needs an ‘update’ verb and an ‘A’ flag for whether it’s active/animated.
  • [X] update app should call update on every active widget on each tick, before it re-renders.
  • [X] implement step ( just render @ update )
  • [X] main loop should call app step instead of render.
  • [X] argument to step should be the time delta since last step (j-kvm.ijs)
  • [X] editor needs a flag/mode that indicates it’s playing (maybe the A flag does this)
  • [X] editor’s update method should play the next character in the macro if it’s animating.

allow speed control per keystroke in the editor.

initially got this for free because it pauses after each keystroke

[4/4] screenplay editor ui

[3/3] implement a scrolling list widget

visible range

current highlight

scroll

show slides and steps in separate panes at bottom

roundtrip to/from org-mode

make kvm a library so syndir can import it

[6/6] extract repl widget

add history widget to repl

implement solution for composite widgets

allow widgets to draw and blit themselves to current terminal

implement blit for vt

make repl a composite widget

draw history whether it’s part of MJE or not

previously

finish parser for xterm color codes (vputs)

widgetize repl history

evaluate and show output

implement ^K -> clear to end of line (d$ in vim?)

don’t hardcode the script path

‘pre-render’ the repl interactions for all slides

  • history can just be the list of lines on the screen
  • at each step, store which one is the bottom-most on screen.
  • then to render, take a window of lines the same size as the terminal
  • for each input there should/could also be an animation of how we arrived at it

implement ‘worlds’ so I can track the state of the system at each point

pre-determine the height of the repl window (H_REPL) for the presentation.

use an in-world variable to track the state of the editor

parse repl inputs from the org file

  • lines starting with ‘: . ’ are editor animations (macros)
  • lines starting with ‘:’ are repl input
  • If a editor animaiton precedes the repl input, it should be treated as a derivation of the input, and an alarm should be triggered if it doesn’t actually produce the expected input.

(this might happen if the editor macro modifies previous inputs and the input history changes due to modifying the narrative)

handle local definitions

I see three alternatives:

  • [X] rewrite the code before it is evaluated (replace =. with =:)
  • execute the code in a separate j process
  • execute the code as part of an immex expression

execute every line starting with ‘:’ (but not ‘: .’) on load

execute each line using the world concept

append output to the echo history

track the repl history length at each step (before and after)

when navigating to a step, render the repl in its ‘before’ state

map each step in the slide to a world

handle box-drawing characters

rewrite special names

ep-10: repl recorder

insert new commands into screenplay

insert keylog macro into screenplay

clear macro after each input

ep-11: macro playback in repl

bugs

fix ctrl-o so it re-opens the file

bug: history is messed up when you press ctrl-o

(needed to fix init_world_)

bug: text added from repl gets discarded

(fix was to use insline instead of ins__cmd)

do not show macros in the repl

(fix was change to new_repl_line)

fix the right side of outline so that it scrolls

height (H) was just set wrong

goz_UiList_ does not scroll correctly (cursor hidden when entering from bottom)

fixed by adding bounds checking to goz

features

get simple macro playback working (using empty start state for now)

  • Play macro when cmd cursor is on macro and you press ‘N’.

track the mark/selection on each line as we load (part of repl state)

  • maybe answer here is to have UiEditWidget produce and consume a state memo

play macros (without pauses) when loading and keep start states for each line

  • tmp is temporary editor object (no need to render)
  • set KPS__tmp to _ for infinite speed
  • set TSV__tmp to 0 to turn off random variation
  • call do__tmp with the macro
  • just call update_tmp 1 until A__tmp is 0
  • state for next iteration is B__tmp
  • save start states in olr

play macros from the line’s starting state when ‘N’ is pressed

rejms-14

“focus color” for cursors in list, edit, repl

rejms-15 : 5 easy changes

make sure R=:0 in render__repl (in update, copy R from ed)

I set TSV=0 in macro player. it should be 1.

actually i don’t use ?TSV, i use TSV*?0 so it’s in seconds.

[#A] make A=:1 the default for widgets

[#A] backspace key in editor

needed to manually copy all keyboard handlers.

don’t break on kc_m

reorganize mje so that all keybindings map to named verb

(instead of verb definition)

rejms-16 : repl enhancements

[#A] colorize input history for standalone repl

start repl cursor at top of the screen

rejms-17 : working repl in jprez

inserting repl->script mis-manages start state

part of this was clearing the worlds, and part was setval__tmp''

[#C] clear “future” worlds on input

[#C] rebuild worlds on delete

run the command and show the output in the repl

tab to switch between outline and repl

rejms-18 : repl command history

[4/4] [#A] tie repl to the command history

Pressing up or down should let you navigate the input history. This history is provided by worlds.ijs.

  • [X] maintain an internal (invisible) list widget hist with input history
  • [X] last item in hist is the current edit buffer (set by up-arrow)
  • [X] on up arrow:
    • [X] if i’m at the end of list, then update the list else ok
    • [X] call bak__hist to move the history cursor
    • [X] set B to val__hist
  • [X] on down arrow:
    • call fwd__hist
    • set B to val__hist

rejms-19 : history fixes

fix length error: getlog__ed when the log is empty.

fix length error in exec when input is empty.

pressing up, and then down should restore the line

create pluggable on_arup and on_ardn event handlers

record the history navigation in the macro

command history for standalone repl (keybinding issue)

playback of j/k keys in macro player (up/down arrows)

stopgap method to get input history into repl widget

right now it just sets the history when the focus changes, and it includes the entire input history.

properly handle history in playback

this is handled by reset_rhist when focus changes or you play macro. this way we get the exact history at that point in time.

rejms-20 : backlog grooming 2

rename mje.ijs to jprez.ijs (or at least main.ijs)

^c / in repl/line-editor should not break whole application

one exit key is enough. (fix was to remove the 3 in j-kvm.ijs)

rejms-21 : start on table-driven keybindings (tag only in j-kvm)

rejms-22 : table-driven keybindings part 2*

[#A] make keybindings table-driven (so people can choose which keys they use for input)

  • edit: refactor so that keys, macro recording, and verb to execute (for live binding or macro playback) are all defined in one table
  • maybe the quick answer for keyboard layouts is to just put that in a separate file?
  • or have two tables: one mapping macro code <-> function name, and another for key <-> macro or key <-> function

rejms-23 : start multi-line editor

[#A] Define Text Editor Component

(right now, the jprez editor is just a plain UiWidget)

code editor should extend the UiList

we can start with the idea that the editor is just a list of lines therefore, extend the UiListWidget

create of_self adverb

[#B] draw the editor cursor(s)

render the tokenized LIST with an extra cursor drawn on top.