Commit Graph

1564 Commits

Author SHA1 Message Date
Kartik K. Agaram 230b903df8 avoid the overflow button in some narrow cases 2023-12-01 20:15:46 -08:00
Kartik K. Agaram 0d2d85d8d7 activate buttons for some time
The active state has 2 uses:
* It gives some visual feedback that a button has been pressed.
  Otherwise, tapping a button gave no feedback that the tap had
  occurred. Particularly on a phone screen where fat-fingering is
  easier, hitting the 'save' button in particular gave no hint that the
  file had actually been saved. Which causes some anxiety.
* It suppresses all mouse taps during the activation time. For example,
  this helps keep tapping say an overflow button from selecting text in
  the editor.
2023-12-01 20:07:20 -08:00
Kartik K. Agaram d85c246cfb bugfix: avoid overflowing 'delete' button in some situations 2023-12-01 19:59:23 -08:00
Kartik K. Agaram d0e2e682c5 bugfix: autosave settings
Before this commit we were only saving settings when explicitly hitting
the 'settings' button to dismiss the menu. But clicking anywhere outside
the menu dismisses it.
2023-12-01 19:55:51 -08:00
Kartik K. Agaram 5875196422 bugfix: hit 'clear' with text selected
Before this commit, selecting some text and then hitting the 'clear'
button would crash the app.
2023-12-01 19:53:14 -08:00
Kartik K. Agaram 750ef9d54d remove warning about persistence from Readme 2023-11-26 13:39:26 -08:00
Kartik K. Agaram f53b5d4b8f more minor tweaks to examples 2023-11-26 12:54:34 -08:00
Kartik K. Agaram f7ba3b93da brief note about the 'save' button 2023-11-26 12:53:11 -08:00
Kartik K. Agaram f8f6cbf37d clarify wording on a couple of examples
Thanks Mike Stein.
2023-11-26 12:34:22 -08:00
Kartik K. Agaram 2c3cc40aa7 position recent definitions on default map 2023-11-26 12:29:13 -08:00
Kartik K. Agaram f3965c61e8 save the list of open files across restart 2023-11-26 12:26:22 -08:00
Kartik K. Agaram 6aa19f1086 bugfix: crash when saving to empty file
Thanks Rebecca Allard for catching this.
2023-11-26 10:51:15 -08:00
Kartik K. Agaram 99df5b8b1a bugfix: bring output border up to date 2023-11-26 10:33:22 -08:00
Kartik K. Agaram 07b4fce750 ok/cancel buttons in file dialog 2023-11-26 10:21:42 -08:00
Kartik K. Agaram d71e7fcfc8 extract a function 2023-11-26 09:53:09 -08:00
Kartik K. Agaram f1ddd6b8da hoist a temporary inside a function 2023-11-26 09:49:54 -08:00
Kartik K. Agaram cbe2f51382 delete dead code 2023-11-26 09:36:10 -08:00
Kartik K. Agaram dc4cf14d28 make it look more like a dialog 2023-11-26 09:21:09 -08:00
Kartik K. Agaram b517a75eb9 filter file list based on input 2023-11-26 09:14:55 -08:00
Kartik K. Agaram 14f13471fd bugfix: reset some more state 2023-11-26 09:10:03 -08:00
Kartik K. Agaram 3c56c2133d reset file system state with everything else 2023-11-26 09:09:32 -08:00
Kartik K. Agaram daf75130d4 bugfix: skipping files near right margin 2023-11-26 09:04:42 -08:00
Kartik K. Agaram 1b898d4a2e type out a filename to load/save 2023-11-26 08:52:34 -08:00
Kartik K. Agaram 83ebcaa5c4 first draft of load/save buttons
Some considerations in the design so far:
* Desired flows:
  * start typing into a new pane, then save to a filename
  * load from a filename, then continue typing/running
  * save as a second file

* Should we autosave? I think not yet, because my editor's undo/redo
  functionality is not accessible yet on mobile. Android devices can't
  press 'ctrl', and the hotkeys aren't very discoverable.

  (I considered menu options for 'undo' and 'redo', but they won't be
  very ergonomic because my undo/redo functionality is primitive and
  doesn't support grouping similar operations. Now you're stuck tapping
  '>>', then 'undo' and losing one character. Then the menu closes and
  you have to do it all over again.)

  Another knock against autosave on mobile: autosave on quit is
  unreliable. At least on my Android devices, LÖVE doesn't trigger
  love.quit when you swipe away an app. iOS of course has no such notion
  in the first place.

* Menu buttons take up space, and I'm loath to expend 2 more buttons.
  However, I don't see a good alternative:

  * We can't use a single button to bind a filename to a pane until we
    get autosave.

  * Save on run? It doesn't save a button, but maybe we can keep 'save'
    up top because we'll want to keep hitting it in the absence of
    autosave. However, I don't want to lose data just because I started
    typing out a long program that never got to a runnable point.

* I'd like to keep 'save' always up. But newcomers might have more
  trouble finding things if load and save are separated from each other.
  Seems like the sort of thing Mike complained about before the current
  button organization.

==> conclusion: no autosave, 2 buttons, load and save

* I want to follow MiniIDE and only save to a single directory (no
  subdirectories, even). Simplifies the file dialog.

* Where should this directory live? Source base risks growing really
  large and unwieldy over time as we share files between lots of LÖVE
  apps. At least, Mike has that problem. Save dir is utterly
  inaccessible to other apps -- including later versions of this one.
  Once you delete one version of an app (say before installing a new
  version) the only way to find your files is to wade through lots of
  cryptic directories inside source dir. And you'd need a new LÖVE app
  to do that.

==> conclusion: save to a fixed subdir of source base dir. That way only
Lua Carousel will save there, but different versions share a common
space.

* Should examples be savable? If yes, we could have conflicts. If no,
  it feels like a gotcha when someone starts editing an example.

==> conclusion: allow examples to be saved, but that creates a new copy
of them on restart. It'll be weird that the order changes, but seems
like the best option.

* Where to show the current filename? I don't want to further reduce
  space for buttons. A smaller font seems necessary here to squeeze the
  filename into an interstitial of the UI.

Still to do: providing a non-existing file to load/save. I plan a
command palette UI for filtering or selecting a new file.
2023-11-25 23:40:28 -08:00
Kartik K. Agaram 54ef90bca7 extract a second helper for buttons 2023-11-25 23:03:36 -08:00
Kartik K. Agaram 3e17033a87 extract a helper for buttons 2023-11-25 21:11:24 -08:00
Kartik K. Agaram 28d450563e delete some old code 2023-11-25 19:07:06 -08:00
Kartik K. Agaram dbfa07f059 bugfix: code overflowing lower border after resize 2023-11-25 18:59:25 -08:00
Kartik K. Agaram 0c8722ac7f bugfix: save settings on mobile devices 2023-11-25 18:29:32 -08:00
Kartik K. Agaram 950f836e0b Merge template-live-editor-mobile 2023-11-25 16:12:16 -08:00
Kartik K. Agaram cc10e9c211 Merge template-live-editor 2023-11-25 16:10:39 -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 16332eef73 hide other menus when opening one 2023-11-25 09:10:05 -08:00
Kartik K. Agaram bfe7f3a16f really really ignore invisible sliders X-( 2023-11-24 21:28:21 -08:00
Kartik K. Agaram ddd47fc1e4 ignore all interactive handlers when editor is open 2023-11-24 21:14:41 -08:00
Kartik K. Agaram ec034bb758 responsive layout for settings menu 2023-11-24 21:03:15 -08:00
Kartik K. Agaram 22bbb4c104 bugfix: _really_ ignore invisible sliders 2023-11-24 20:52:06 -08:00
Kartik K. Agaram 2fee071872 Merge template-live-editor-mobile 2023-11-24 19:43:29 -08:00
Kartik K. Agaram 5f43fd7341 Merge template-live-editor 2023-11-24 19:42:09 -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 caafb3e4e6 2 bugfixes in font rendering 2023-11-24 18:38:37 -08:00