Commit Graph

1601 Commits

Author SHA1 Message Date
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 f6bc670ef6 yet another bugfix to the version check
We could now get test failures before the version check, which might be
confusing.
2023-12-03 12:30:16 -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 d58c733a30 Merge text0 2023-12-03 11:43:26 -08:00
Kartik K. Agaram 0ec556deec Merge text.love 2023-12-03 11:41:48 -08:00
Kartik K. Agaram df2cfb820d Merge lines.love 2023-12-03 11:25:16 -08:00
Kartik K. Agaram 0d3db19c85 clearing starty is redundant in mutations
We'll end up calling Text.redraw_all anyway, which will clear starty and
much more besides.

We'll still conservatively continue clearing starty in a few places
where there's a possibility that Text.redraw_all may not be called. This
change is riskier than most.
2023-12-03 10:32:05 -08:00
Kartik K. Agaram 7bbc10fffb Merge text0 2023-12-01 22:24:42 -08:00
Kartik K. Agaram 5a2581bf71 Merge text.love 2023-12-01 22:24:03 -08:00
Kartik K. Agaram 52ffb40d79 Merge lines.love 2023-12-01 22:17:43 -08:00
Kartik K. Agaram 8399c42707 mouse button state in source editor 2023-12-01 22:07:24 -08:00
Kartik K. Agaram 120f4ccf1b Merge text.love 2023-12-01 22:06:34 -08:00
Kartik K. Agaram 61336b491b Merge lines.love 2023-12-01 22:03:36 -08:00
Kartik K. Agaram 8a588880b7 manually maintain mouse button press state
Just checking mouse.isDown works if the editor is the entirety of the
app, as is true in this fork. However, we often want to introduce other
widgets. We'd like tapping on them to not cause the selection to flash:
  https://news.ycombinator.com/context?id=38404923&submission=38397715

The right architecture to enforce this is: have each layer of the UI
maintain its own state machine between mouse_press and mouse_release
events. And only check the state machine in the next level down rather
than lower layers or the bottommost layer of raw LÖVE.
2023-12-01 21:56:35 -08:00
Kartik K. Agaram 7fa185dc99 Merge text0 2023-11-25 16:10:10 -08:00
Kartik K. Agaram a143125743 Merge text.love 2023-11-25 16:09:24 -08:00
Kartik K. Agaram 01c0b8e847 Merge lines.love 2023-11-25 16:01:29 -08:00
Kartik K. Agaram 9ed7c576e6 port keyboard layout handling to source editor 2023-11-25 15:31:42 -08:00
Kartik K. Agaram aed0eb592a Merge lines.love 2023-11-25 15:27:12 -08:00
Kartik K. Agaram f6420efd90 improved handling of other keyboard layouts 2023-11-25 15:20:55 -08:00
Kartik K. Agaram dbc0c1fe28 Merge text0 2023-11-24 19:41:06 -08:00
Kartik K. Agaram 7618023da2 Merge text.love 2023-11-24 19:40:14 -08:00
Kartik K. Agaram 5561ebf06f Merge lines.love 2023-11-24 19:36:26 -08:00
Kartik K. Agaram c1f7f17f9c bugfix: infinite loop inside a very narrow window
I'm not sure this can trigger everywhere (I've only been able to
exercise it in Lua Carousel), but it seems like a safety net worth
having against future modifications by anybody.
2023-11-24 19:19:29 -08:00
Kartik K. Agaram 0751b38932 establish a fairly fundamental invariant
This commit doesn't guarantee we'll always catch it. But if this
invariant is violated, things can get quite difficult to debug. I found
in the Lua Carousel fork that all the xpcalls I keep around were
actively hindering my ability to notice this invariant being violated.
2023-11-24 19:16:33 -08:00
Kartik K. Agaram 68ba1eeb6e handlers for _all_ LÖVE events 2023-11-22 12:31:37 -08:00
Kartik K. Agaram 85020fe21d Merge text0 2023-11-18 15:27:16 -08:00
Kartik K. Agaram f08a485f07 Merge text.love 2023-11-18 15:25:32 -08:00
Kartik K. Agaram 096f9bf720 Merge lines.love 2023-11-18 15:06:48 -08:00
Kartik K. Agaram 48c05aa77a late-bind my App.* handlers
This came up when trying to integrate my apps with the vudu debugger
(https://github.com/deltadaedalus/vudu). In general, it's a subtle part
of LÖVE's semantics that you can modify event handlers any time and your
modifications will get picked up. Now my Freewheeling Apps will follow
this norm as well.
2023-11-18 14:15:07 -08:00
Kartik K. Agaram 61f95a349b Merge text0 2023-11-18 12:53:21 -08:00
Kartik K. Agaram c3effcc850 Merge text.love 2023-11-18 12:49:34 -08:00
Kartik K. Agaram de66b015bc Merge lines.love 2023-11-18 12:21:30 -08:00
Kartik K. Agaram 007b965b11 audit all asserts
Each one should provide a message that will show up within LÖVE. Stop
relying on nearby prints to the terminal.

I also found some unnecessary ones.

There is some potential here for performance regressions: the format()
calls will trigger whether or not the assertion fails, and cause
allocations. So far Lua's GC seems good enough to manage the load even
with Moby Dick, even in some situations that caused issues in the past
like undo.
2023-11-18 11:32:01 -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 cda85faf3b remove cruft handler 2023-11-13 09:44:59 -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