Commit Graph

450 Commits

Author SHA1 Message Date
Kartik K. Agaram b392da1625 oh, switch the name 2023-11-23 10:17:35 -08:00
Kartik K. Agaram b7345d85fc Merge template-live-editor-mobile 2023-11-22 12:38:31 -08:00
Kartik K. Agaram e38dc202c3 Merge template-live-editor 2023-11-22 12:32:42 -08:00
Kartik K. Agaram 68ba1eeb6e handlers for _all_ LÖVE events 2023-11-22 12:31:37 -08:00
Kartik K. Agaram 086062791f fix repeating backspace on iOS 2023-11-21 22:58:16 -08:00
Kartik K. Agaram 9f21230005 Merge template-live-editor-mobile 2023-11-19 12:07:16 -08:00
Kartik K. Agaram 239077e8e1 bugfix: initial textinput event on iOS
`love.textinput` is fragile on iOS. Various things can cause an app to
stop receiving textinput events. Resizing the window is one reliable
way, but there's also another ghost, something that's triggering on
every frame of LÖVE.

Fortunately, it looks like `love.keyboard.setTextInput(true)` reliably
resubscribes the app to textinput events, regardless of their cause.

https://github.com/love2d/love/issues/1959

The one remaining open question here is why the call in
`App.keychord_press` (equivalent to `love.keypressed`) doesn't fix the
breakage caused by the initial window resize (that happens before any
keys are pressed). I've confirmed that `keypressed` comes before
`textinput` on iOS just like everywhere else.
2023-11-19 10:57:10 -08:00
Kartik K. Agaram d59b70979b Merge template-live-editor-mobile 2023-11-19 09:44:53 -08:00
Kartik K. Agaram 864ee0a8b2 reuse API call 2023-11-19 09:43:08 -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 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 5417703ccc mobile devices tend to need OS checks 2023-11-16 13:08:25 -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 534224f0cc new fork: for mobile devices 2023-11-12 22:33:24 -08: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
Kartik K. Agaram ffa8c4041a bugfix: bring back an accidentally deleted line
Caused by a bad merge in commit 5622e523c.

Thanks Myte#5310 on Discord.
2023-08-05 00:09:04 -07:00
Kartik K. Agaram 5622e523c3 Merge text0 2023-07-11 11:15:46 -07:00
Kartik K. Agaram c3f8250cb2 Merge text.love 2023-07-11 11:11:48 -07:00
Kartik K. Agaram cc67c641dc Merge text0 2023-07-10 19:07:02 -07:00
Kartik K. Agaram f8930488aa Merge text.love 2023-07-10 18:41:23 -07:00
Kartik K. Agaram 7b5ede43e2 slightly standardize on app-specific stuff 2023-06-18 22:44:27 -07:00
Kartik K. Agaram 7e160e0de5 maintain the initial font size in a global
Apps should keep the global updated when changing the font size.
2023-06-05 22:18:44 -07:00
Kartik K. Agaram 44e3cdcdb7 Merge text0 2023-06-04 15:34:49 -07:00
Kartik K. Agaram 484602bd9e Merge text.love 2023-06-04 15:25:46 -07:00
Kartik K. Agaram 4fb97b9d34 bugfix: wasn't recovering from errors
Bug was introduced in commit a2451aa26 32 hours ago, because I didn't go
over the manual tests for the error-handling protocol after modifying
the error-handling protocol. (I only tested them in template-live.)
2023-04-21 08:18:00 -07:00
Kartik K. Agaram c95bffed88 Merge text0 2023-04-20 18:28:23 -07:00
Kartik K. Agaram 6d86b5268b drop an unused var 2023-04-20 18:27:46 -07:00
Kartik K. Agaram a2451aa26e attempt at better error recovery
- I often find that opening up driver.love and sending any message gets
  my app unwedged. Retrying should be easy. Just press a key.
- There's really no reason for the app to become unresponsive while
  waiting for code changes.

This approach tries to address both. Press any key to retry, or show the
error right on the window while I whip out driver.love. You can also
copy the message to the clipboard by hitting 'c'.

Drawbacks of this approach:
  - nobody's going to read the message. I myself didn't notice the
    default support for copying the error message for _months_.
  - more complexity for anyone reading the code to parse. More stuff
    that can go wrong. Any errors within the handler will crash the app
    hard. (Though now there's less code in the handler, so maybe this is
    an improvement on that score.)

The best plan is still to not rely on this too much. Don't ship bugs.
2023-04-20 00:30:25 -07:00
Kartik K. Agaram 71c82e5c09 document available modes 2023-04-19 23:16:46 -07:00
Kartik K. Agaram 5561486cb6 Merge text0 2023-04-19 19:47:42 -07:00
Kartik K. Agaram c95dc559c8 record support for multiple versions 2023-04-19 19:45:17 -07:00
Kartik K. Agaram 0d913ba8f1 Merge lines.love 2023-04-09 14:14:03 -07:00
Kartik K. Agaram 4b43e9e85d deemphasize the source editor
This repo does not support freewheeling modification. It's a primitive
to enable freewheeling modification in downstream forks.

The source editor is a convenience, but it's a sharp tool and can easily
leave the app in a broken state that requires dropping down to external
tools (editor, file manager) to fix.
2023-04-09 11:12:36 -07:00
Kartik K. Agaram f387c40d95 restart on a remote command from the driver
This should be useful for ensuring that apps work the same after
restart.
2023-04-07 18:18:43 -07:00
Kartik K. Agaram f3748b9003 bugfix for merge commit 2023-04-02 17:48:11 -07:00
Kartik K. Agaram f78503b971 bugfix for merge commit 2023-04-02 17:47:09 -07:00
Kartik K. Agaram 5b90b50776 stray dead code 2023-04-02 17:27:26 -07:00