Commit Graph

1428 Commits

Author SHA1 Message Date
Kartik K. Agaram ff14bfd4ce bugfix: stay within window boundaries
scenario: type a single long line wrapping past bottom of line

Before this commit we were overflowing the window.
Root cause: not understanding the precise semantics of edit.bottom.
Many of our apps want to print an extra line just so we can see the
letters peeking out from the bottom.
2023-11-18 03:56:10 -08:00
Kartik K. Agaram 056b5e021f Merge template-live-editor-mobile 2023-11-17 15:46:22 -08:00
Kartik K. Agaram a600890e8f Merge template-live-editor 2023-11-17 15:33:48 -08:00
Kartik K. Agaram b55bb76f30 fix startup test failures from the driver
Still klunky in one place: when you open the driver the failing test
isn't highlighted in red. I need to communicate the structured data of
test failures in run-time errors when the tests weren't triggered by a
driver command.
2023-11-17 14:34:54 -08:00
Kartik K. Agaram 290541fcc5 . 2023-11-17 14:31:56 -08:00
Kartik K. Agaram 375c7fe0db bugfix: handle a missing save dir
Scenario:
  * run a whole new app (no save dir yet) as a .love file
  * open the driver, make an edit

Before this commit, I was seeing errors due to the save dir not
existing. Let's depend on love.filesystem as needed. Another "good seam"
IMO (https://lobste.rs/s/idi1wt/open_source_vs_ux).
2023-11-17 12:32:43 -08:00
Kartik K. Agaram efbceab81a confirmed error-recovery in a few more parts 2023-11-17 12:27:31 -08:00
Kartik K. Agaram a428068d3e fix initialization errors using driver.love
Changes inside on.initialize are minefields. Until now, if you made a
mistake when modifying on.initialize, you could end up in a situation
where the app would fail irrecoverably on the next startup. You'd have
to go dig up a text editor to fix it.

After this commit, errors in on.initialize wait for commands from
driver.love just like any other error.

Recovering from errors during initialization is a little different than
normal. I don't know how much of initialization completed successfully,
so I redo all of it.

I think this should be safe; the sorts of things we want to do on
startup tend to be idempotent just like the sorts of things we do within
an event loop with our existing error handling.

Things are still not ideal. Initialization by definition happens only
when the app starts up. When you make changes to it, you won't find out
about errors until you restart the app[1], which can be much later and a
big context switch. But at least you'll be able to fix it in the usual
way. Slightly more seamless[2].

One glitch to note: at least on Linux, an app with an initialization
error feels "sticky". I can't seem to switch focus away from it using
Alt-tab. Hitting F4 on the driver also jarringly brings the client app
back in focus when there was an initialization error. But the mouse does
work consistently. This feels similar to the issues I find when an app
goes unresponsive sometimes. The window manager really wants me to
respond to the dialog that it's unresponsive.

Still, feels like an improvement.

[1] I really need to provide that driver command to restart the app! But
there's no room in the menus! I really need a first-class command
palette like pensieve.love has!

[2] https://lobste.rs/s/idi1wt/open_source_vs_ux
2023-11-17 11:55:57 -08:00
Kartik K. Agaram ef5e7e0556 don't hide errors when driver.love connects
The intent of hiding errors is to see if a code change I made improved
things. But many commands from the driver don't involve a code change.
It seems more useful to leave the error up in those situations.
2023-11-16 23:12:14 -08:00
Kartik K. Agaram 90dc7ce6dc run all tests on startup 2023-11-16 22:10:03 -08:00
Kartik K. Agaram 5417703ccc mobile devices tend to need OS checks 2023-11-16 13:08:25 -08:00
Kartik K. Agaram 31bb55d18d bugfix: output border color 2023-11-15 13:07:01 -08:00
Kartik K. Agaram e03d3ea172 responsively increase/decrease font height
Only using hotkeys for now, which are only available on non-mobile
devices, and not very discoverable. But this is an accessibility
foundation.
2023-11-15 09:30:17 -08:00
Kartik K. Agaram 1f272c9d39 mock up rest of menu bar and nav buttons 2023-11-15 09:02:22 -08:00
Kartik K. Agaram d6abaaa582 resize handler 2023-11-15 07:37:36 -08:00
Kartik K. Agaram 28f1e113a4 start of the visual skeleton 2023-11-15 07:04:34 -08:00
Kartik K. Agaram 72210616c7 editor widget now takes a bottom margin
This seems easy! :crossed-fingers:
2023-11-15 06:14:07 -08:00
Kartik K. Agaram 01a8e0bb9f new fork: carousel shell 2023-11-15 06:06:56 -08:00
Kartik K. Agaram 7ddeff547b support high-DPI devices 2023-11-15 05:48:07 -08:00
Kartik K. Agaram 331d5eda40 more reliable textinput events on iOS
Thanks Mike Stein for coming up with this solution.
2023-11-13 23:44:08 -08:00
Kartik K. Agaram cda85faf3b remove cruft handler 2023-11-13 09:44:59 -08:00
Kartik K. Agaram 534224f0cc new fork: for mobile devices 2023-11-12 22:33:24 -08:00
Kartik K. Agaram cd28ae8fff Merge text0 2023-11-12 20:06:15 -08:00
Kartik K. Agaram 8ec59b36b2 Merge text.love 2023-11-12 20:05:31 -08:00
Kartik K. Agaram a8dc0ee2be Merge lines.love 2023-11-12 19:53:58 -08:00
Kartik K. Agaram 5cce511550 remove some dead code
We have an early exit for 'error' mode in this function.
2023-11-12 17:14:37 -08:00
Kartik K. Agaram 7057ac74ec check for 'error' mode in a few more places
In particular, I want to be able to switch to 'error' mode rather than
throw a real error() on test failures, because that's a little more
responsive and might be recoverable. (On some Android devices the font
is slightly different, and tests fail as a result.)
2023-11-12 16:31:12 -08:00
Kartik K. Agaram d2a9ef873d suggest a default layout for freewheeling apps 2023-11-11 10:31:25 -08:00
Kartik K. Agaram acc6e97db0 debug animations
https://merveilles.town/@akkartik/111333888472146119
2023-11-11 10:00:54 -08:00
Kartik K. Agaram d49dd49dd6 Merge text0 2023-11-10 16:51:04 -08:00
Kartik K. Agaram 6adc5f5ae0 Merge text.love 2023-11-10 16:50:35 -08:00
Kartik K. Agaram a1da45228a Merge lines.love 2023-11-10 16:40:36 -08:00
Kartik K. Agaram d90dff3286 improve a name 2023-11-10 10:21:52 -08:00
Kartik K. Agaram f86ebf6247 clean up a debug print 2023-11-10 10:20:57 -08:00
Kartik K. Agaram 279c42966b Merge text0
I've tested both syntax error and run-time error flows.
2023-11-10 10:15:35 -08:00
Kartik K. Agaram 69afab3840 Merge text.love 2023-11-10 09:10:20 -08:00
Kartik K. Agaram 3007ea0014 Merge lines.love 2023-11-10 09:05:04 -08:00
Kartik K. Agaram a6738b49c4 clean up some cruft from error callstacks
before:

  stack traceback:
    [string "text.lua"]:9: in function 'draw'
    [string "edit.lua"]:200: in function 'draw'
    [string "run.lua"]:140: in function 'draw'
    [string "main.lua"]:162: in function <[string "main.lua"]:155>
    [C]: in function 'xpcall'
    [string "app.lua"]:38: in function <[string "app.lua"]:20>
    [C]: in function 'xpcall'
    [love "boot.lua"]:370: in function <[love "boot.lua"]:337>

after:

  stack traceback:
    text.lua:9: in function 'draw'
    edit.lua:200: in function 'draw'
    run.lua:140: in function 'draw'
    main.lua:162: in function <[string "main.lua"]:155>
    [C]: in function 'xpcall'
    app.lua:38: in function <[string "app.lua"]:20>
    [C]: in function 'xpcall'
    [love "boot.lua"]:370: in function <[love "boot.lua"]:337>
2023-11-10 08:41:56 -08:00
Kartik K. Agaram 8b70258978 remove a no-op regex munging on callstacks
Port of a fix "upstream": commit b38f172ceb in template-live-editor.
2023-11-10 07:24:46 -08:00
Kartik K. Agaram 66ef316503 strip numeric prefix from callstack filenames 2023-11-10 07:06:37 -08:00
Kartik K. Agaram b38f172ceb remove a no-op regex munging on callstacks
It seems to have been introduced in commit 46889593da back in Jan, and I
was using it to summarize multiple failing tests. However, it's not used
in that scenario anymore (and anyway it seems wasteful to compute the
stack for each failing test and then throw it all away).
2023-11-09 21:16:13 -08:00
Kartik K. Agaram f6ee78f824 bugfix 2023-11-09 18:03:29 -08:00
Kartik K. Agaram cd5ab62971 provide a filename for clearer error callstacks 2023-11-09 17:53:30 -08:00
Kartik K. Agaram 3fb7854008 Merge text0 2023-10-28 01:05:35 -07:00
Kartik K. Agaram 6cc83d5691 Merge text.love 2023-10-28 01:02:30 -07:00
Kartik K. Agaram f737d63c69 Merge lines.love 2023-10-28 00:54:14 -07:00
Kartik K. Agaram aa9a0b0b15 use my name for a dir 2023-10-27 23:58:42 -07:00
Kartik K. Agaram 5d41640d2f remove stale variable from docs 2023-10-27 23:57:18 -07:00
Kartik K. Agaram e310bb11bc Merge text0 2023-10-22 10:18:13 -07:00
Kartik K. Agaram 3985f51aef fix a bullet 2023-10-22 10:16:41 -07:00