Commit Graph

719 Commits

Author SHA1 Message Date
Kartik K. Agaram afb3f46db7 always ask for confirmation on exit
Let's see if we can live with this rather than some way to let apps
indicate if they want confirmation or not..
2022-03-01 23:10:46 -08:00
Kartik K. Agaram 46ef1adb08 zet.tlv: hotkeys are not alternatives
In any case, I want the convention to be '|' for alternation. '/' is
more likely to be a real hotkey.
2022-02-27 09:58:05 -08:00
Kartik K. Agaram 2546d91214 zet.tlv: streamline history 2022-02-27 09:47:09 -08:00
Kartik K. Agaram ae51b06dab starting to make Teliva apps more testable
Tasteful apps should only perform side-effects through 'window'
arguments rather than the 'curses' module directly. It's ok however to
read constants like curses.A_NORMAL or curses.stdscr().

There are some limitations, unfortunately. Ncurses wasn't designed with
testability in mind. For example, there's no way to curs_set or
assume_default_colors without the 'curses' module. Oh well.
2022-02-27 08:41:30 -08:00
Kartik K. Agaram 891bced544 always run unit tests for channels and tasks 2022-02-26 22:57:48 -08:00
Kartik K. Agaram 42526cb15d import https://github.com/majek/lua-channels
Also a little test program to demo channels in action.
2022-02-26 22:48:48 -08:00
Kartik K. Agaram 061e6a21a5 duplicate keypress on failing test 2022-02-26 19:47:06 -08:00
Kartik K. Agaram 7852cdfebe readme tweak 2022-02-26 13:47:54 -08:00
Kartik K. Agaram 3e1fa8c5a7 a little program for kids: anagrams of names 2022-02-21 19:06:16 -08:00
Kartik K. Agaram 52372d1812 delete curses primitives to read whole lines
They make it seem like you can use them to create simple REPL apps, but
you can't, because standard Teliva shortcuts won't work.

I _could_ make them work by emulating them using getch(), but that feels
like an unnecessary abstraction for now.
2022-02-21 17:06:34 -08:00
Kartik K. Agaram f8f1ec666a stop letting apps change directory
I introduced this ability when I packaged up the lfs directory, but it
can enable apps to circumvent sandboxing rules in some situations. If
you can socially engineer someone to allow reading a file called
'passwd' in the current directory, you can now change directory to /etc
and read something sensitive.

Protecting against stuff like this gets subtle. It's easy for people to
create policies that aren't robust to changing directories. Requiring
absolute paths is also pretty unfriendly. So the whole notion of current
directory is perhaps implicit state that is confusing to manage. Fix it
in the context of a single session.
2022-02-20 05:01:28 -08:00
Kartik K. Agaram b36927e35c rewrite the section on Teliva's dependencies 2022-02-19 09:13:52 -08:00
Kartik K. Agaram 557774af42 Readme: move some sections around to flow better 2022-02-19 09:11:40 -08:00
Kartik K. Agaram eb53603b06 starting a few Readme tweaks
For starters, drop some redundant prose here.
2022-02-19 09:10:29 -08:00
Kartik K. Agaram b8cba84d20 bring back pcall and xpcall
They aren't evaluating strings after all.
2022-02-18 18:00:58 -08:00
Kartik K. Agaram 24db182620 show app blurb in screenshot 2022-02-17 20:47:19 -08:00
Kartik K. Agaram 9421ea7151 'doc:blurb': a place to briefly describe an app
This is for what the app does, as opposed to 'doc:main', which is also
intended to include commentary about the internal organization of the
app.
2022-02-17 20:16:36 -08:00
Kartik K. Agaram 0e19efeb2e fix a conflicting keyboard shortcut 2022-02-17 19:44:26 -08:00
Kartik K. Agaram 272d7532dc disable non-portable ASan flags 2022-02-16 20:53:53 -08:00
Kartik K. Agaram 27a99111ee fix chesstv.tlv after we introduced sandboxing 2022-02-12 18:58:24 -08:00
Kartik K. Agaram 3db03840e1 zet.tlv: new shortcuts, mostly for the editor 2022-02-12 17:59:30 -08:00
Kartik K. Agaram 5e200cf96a zet.tlv: some more editor shortcuts 2022-02-12 15:56:12 -08:00
Kartik K. Agaram 6a485ae4b4 stop aborting if audit log fills up
When I started logging getch() events (which are just to help the reader
orient on the log), this suddenly became more urgent.

Now the log is larger, and it's also a circular buffer that rolls back
to the start when it fills up.

The next failure mode will be if we see the buffer filled up with just
getch() calls, reducing visibility over real file and network
operations. In which case we'll need to start coalescing getch() events.
2022-02-12 15:45:04 -08:00
Kartik K. Agaram bbd47aaa5b zet.tlv: yet another bugfix
Need for tests growing more acute..
2022-02-11 10:40:24 -08:00
Kartik K. Agaram 2d3cad5945 fix build on Mac OS 2022-02-10 23:42:09 -08:00
Kartik K. Agaram d7436f047d zet.tlv: fix a couple more bugs
This snapshot was demoed at https://archive.org/details/akkartik-teliva-2022-02-10
2022-02-10 23:40:51 -08:00
Kartik K. Agaram c55956bf96 zet.tlv: cross-links
We also made render dynamic, showing zettels in the first place it
encounters them in depth-first order.

Open question: how to show a collapsed outline view with the data model
I'm experimenting with. Not even clear 'outline' has meaning in the
presence of cross-links. Outliners privilege one view of the network.
Zettelkasten also does so; changing child/sibling relationships is a lot
of work. However, reading between the links it seems to try to provide
an escape hatch for rethinking connections using cross-links. I'm trying
to lean into that -- at the cost of providing outlines. We'll see if
this is a good trade-off.
2022-02-10 21:33:21 -08:00
Kartik K. Agaram feb10708ae hacky support for caller main in file permissions 2022-02-10 16:40:40 -08:00
Kartik K. Agaram c1e4b84222 fixup! clean up top-level Makefile targets 2022-02-10 16:40:22 -08:00
Kartik K. Agaram 76984aa90f allow Teliva to show its sandboxing message 2022-02-10 16:30:00 -08:00
Kartik K. Agaram b0cc9a7451 zet.tlv: refine the initial UX some more
Conundrum:

I want the app to provide some sample data for people to interact with.

However, I also want them to be able to delete it to make it their own.

BUT I'm not yet convinced the app should allow deletion in general.

Besides, deleting stuff robustly and reliably is a whole other level of
programming.

Solution:

Make people edit the app to clear the initial sample zettels.

This has the "beneficial" side-effect of getting them editing apps on
Teliva.
2022-02-10 08:00:47 -08:00
Kartik K. Agaram c4402edc5b zet.tlv: copy in sample zettels 2022-02-10 07:40:04 -08:00
Kartik K. Agaram 1a40bc7f5f zet.tlv: saving/loading to/from disk 2022-02-10 07:35:54 -08:00
Kartik K. Agaram 10dab7ae17 zet.tlv 2022-02-10 07:35:28 -08:00
Kartik K. Agaram 31127a9152 clean up top-level Makefile targets 2022-02-10 06:53:22 -08:00
Kartik K. Agaram 5cab1c042d zet.tlv: resizing zettel card sizes 2022-02-10 00:04:12 -08:00
Kartik K. Agaram e827379950 zet.tlv: creating new zettels 2022-02-09 23:49:59 -08:00
Kartik K. Agaram cf521f9904 zet.tlv: bugfixes to editor cursor handling 2022-02-09 23:41:36 -08:00
Kartik K. Agaram 7786462a8d . 2022-02-09 23:27:26 -08:00
Kartik K. Agaram 38b15e8086 flesh out sandboxing in Readme a tad 2022-02-09 14:47:01 -08:00
Kartik K. Agaram 29d4555d04 update keyboard shortcuts in screenshots and docs 2022-02-09 14:39:31 -08:00
Kartik K. Agaram e552571b1e standardize key order in .tlv files
This will eliminate some spurious git diffs I keep having to clean up.
2022-02-09 09:18:05 -08:00
Kartik K. Agaram b328ffc5e5 zet.tlv: simpler UI, simpler editor 2022-02-09 08:31:20 -08:00
Kartik K. Agaram c3422e101f bugfix in rendering non-top zettels 2022-02-08 19:20:13 -08:00
Kartik K. Agaram e397220f9d Lua gotcha: iterating over strings yields strings 2022-02-08 19:19:08 -08:00
Kartik K. Agaram 33ab842ffd zet.tlv: expand editor to accomodate more text
Still won't show up in view mode for now. Soon we'll be able to adjust
zettel dimensions.
2022-02-08 18:40:59 -08:00
Kartik K. Agaram 3180e3e4fb typo 2022-02-08 18:30:02 -08:00
Kartik K. Agaram fb251c2819 zet.tlv: editing a single zettel 2022-02-08 00:28:20 -08:00
Kartik K. Agaram a8fb6d4002 gemini.tlv: consistent menu 2022-02-08 00:28:04 -08:00
Kartik K. Agaram b639f8e68c zet.tlv: clean up history 2022-02-07 23:17:03 -08:00