Commit Graph

490 Commits

Author SHA1 Message Date
Kartik K. Agaram 63752a68ff Merge template-live-editor 2024-01-15 03:29:50 -08:00
Kartik K. Agaram 83881938f5 Merge text0 2024-01-15 02:33:22 -08:00
Kartik K. Agaram 7a7b218c44 delete some dead code 2024-01-15 02:31:13 -08:00
Kartik K. Agaram 6806a328ff Merge template-live-editor 2023-12-29 15:41:15 -08:00
Kartik K. Agaram 2ad6f1643e bugfix
scenario:
  delete config from save dir
  run the app
  quit
  run the app again

After the stupid typo in the previous commit the app was stuck emitting
errors during the second run.
2023-12-29 15:16:57 -08:00
Kartik K. Agaram dad4b59ef5 Merge text0 2023-12-29 14:50:28 -08:00
Kartik K. Agaram 3b601dcbcf Merge text.love 2023-12-29 14:44:27 -08:00
Kartik K. Agaram 307153f9a5 Merge template-live-editor 2023-12-26 09:34:27 -08:00
Kartik K. Agaram fbf99b040d wire up mouse move handler 2023-12-26 08:28:23 -08:00
Kartik K. Agaram 6820ebbff6 Merge template-live-editor 2023-12-07 09:10:53 -08:00
Kartik K. Agaram b18b1d99f3 merge bugfix
Here it _is_ a bug that Mode can be nil.
2023-12-07 08:54:35 -08:00
Kartik K. Agaram 265fa397fa merge quasi-bug
This doesn't cause problems in this particular fork, but it's still
muddy that Mode can be nil.
2023-12-07 08:49:52 -08:00
Kartik K. Agaram 07cc25443f Merge template-live-editor 2023-12-07 01:24:38 -08:00
Kartik K. Agaram 730a8768f6 Merge text0 2023-12-07 01:22:19 -08:00
Kartik K. Agaram c53d6b6a7d Merge text.love 2023-12-07 01:21:18 -08:00
Kartik K. Agaram 17810bf766 Merge lines.love 2023-12-07 01:17:11 -08:00
Kartik K. Agaram 366d806515 copy correct warning message
Not really useful here, but other forks might make use of it.
2023-12-07 01:08:09 -08:00
Kartik K. Agaram e7b51de205 Merge template-live-editor 2023-12-07 00:57:37 -08:00
Kartik K. Agaram e3c8121381 Merge text0 2023-12-07 00:51:29 -08:00
Kartik K. Agaram 23eb55f634 Merge text.love 2023-12-07 00:11:31 -08:00
Kartik K. Agaram 972b198e5f Merge lines.love 2023-12-06 23:34:24 -08:00
Kartik K. Agaram 8c97755480 hide some details within the 'warning' state
Renamed from the 'error' state.

Now we no longer overload Error_message; it's only used for actual
errors that trigger opening the source editor.

I was tempted to hide Skip_rest_of_key_events inside the 'warning' state
as well, but that isn't right. It applies to all Current_app
transitions, not just those in and out of 'warning'.
2023-12-06 22:59:24 -08:00
Kartik K. Agaram 19597e7619 redo version checks yet again
I'm starting to feel better after replacing 1 line with 20 and 2 new
bits of global state. I'm now handling two scenarios more explicitly:

* If I change Current_app within key_press, the corresponding text_input
  and key_release events go to the new app. If it's an editor it might
  insert the key, which is undesirable. Putting such handlers in
  key_release now feels overly clever, particularly since it took me
  forever to realize why I was getting stuck in an infinite loop.

* Both 'run' and 'source' can hit the version check, so we need to be
  able to transition from the 'error' app to either. Which
  necessitates yet another global bit of state: Next_app.
2023-12-06 22:43:28 -08:00
Kartik K. Agaram 01a26cad5f redo version checks
This is still ugly, but hopefully easier to follow.
2023-12-06 20:14:24 -08:00
Kartik K. Agaram d249ad2913 Merge template-live-editor 2023-12-03 13:30:09 -08:00
Kartik K. Agaram cdbbe56519 Merge text0 2023-12-03 13:21:55 -08:00
Kartik K. Agaram 20d2b3e460 Merge text.love 2023-12-03 13:18:22 -08:00
Kartik K. Agaram 67eb28ef1c Merge lines.love 2023-12-03 13:01:49 -08:00
Kartik K. Agaram f37b45196a speculatively recommend new LÖVE v11.5 in all forks 2023-12-03 12:12:56 -08:00
Kartik K. Agaram 9993014904 bugfix: version check 2023-12-03 12:11:17 -08:00
Kartik K. Agaram a82a14ddf9 Merge template-live-editor 2023-11-22 12:43:39 -08:00
Kartik K. Agaram 68ba1eeb6e handlers for _all_ LÖVE events 2023-11-22 12:31:37 -08:00
Kartik K. Agaram 695e8de166 Merge template-live-editor 2023-11-17 16:09:02 -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 90dc7ce6dc run all tests on startup 2023-11-16 22:10:03 -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 6cc83d5691 Merge text.love 2023-10-28 01:02:30 -07:00
Kartik K. Agaram 4cd624f745 Merge template-live-editor 2023-10-09 21:24:13 -07:00
Kartik K. Agaram a4f6165ee7 Merge text0 2023-10-09 21:18:58 -07:00
Kartik K. Agaram d5b23f1a2e merge bugfix 2023-10-09 21:17:15 -07:00
Kartik K. Agaram 8d50a56eb7 Merge text0 2023-10-09 21:15:21 -07:00
Kartik K. Agaram 3c92631bdf Merge text.love 2023-10-09 21:13:28 -07:00
Kartik K. Agaram b84cbf6d21 Merge lines.love 2023-10-09 20:55:24 -07:00
Kartik K. Agaram 6e391d7875 start supporting LÖVE v12
To do this I need some support for multiple versions. And I need an
'error' mode to go with existing 'run' and 'source' modes
(`Current_app`). Most errors will automatically transition to 'source'
editor mode, but some errors aren't really actionable in the editor. For
those we'll use 'error' mode.

The app doesn't yet work with LÖVE v12. There are some unit tests failing
because of differences in font rendering.
2023-10-09 20:05:19 -07:00
Kartik K. Agaram 37cb030489 Merge lines.love 2023-09-10 21:56:43 -07:00
Kartik K. Agaram 7062963888 Revert "deemphasize the source editor"
Now that we have decent error handling, I think we can encourage people
to press ctrl+e again.

This reverts commit 4b43e9e85d.
2023-09-10 21:45:59 -07:00
Kartik K. Agaram 529857ad73 Merge lines.love 2023-09-04 15:22:10 -07:00
Kartik K. Agaram e74b92b733 show any error after switching to source editor
Error_message is a special global. It's set when the app (Current_app = 'run')
encounters an error and switches to the source editor, and cleared when
switching from source editor back to the app.
2023-09-04 15:07:54 -07:00