Commit Graph

1787 Commits

Author SHA1 Message Date
Kartik K. Agaram e848a890ef shield script from touch events when showing editor 2024-03-22 17:29:29 -07:00
Kartik K. Agaram a7fb944976 use an available constant 2024-03-17 11:56:42 -07:00
Kartik K. Agaram 1f42711dde indicate unsaved changes 2024-03-17 11:01:25 -07:00
Kartik K. Agaram 6c596c0bcd hoist next_save to all saves
Now we can rely on its state even when we don't rely on autosave.
2024-03-17 10:54:26 -07:00
Kartik K. Agaram fff4dc198c explicitly state stance on autosave 2024-03-17 10:49:45 -07:00
Kartik K. Agaram ff27ad6ad4 swap copy and paste menu buttons
Scenario: every once in a while I try to paste on my phone (in the
overflow menu) and fat finger and tap 'clear' next to it instead.

I could try adding space between the buttons in the overflow menu, but
that creates cascading issues of how it should look. Swapping these two
buttons is a hacky way to ensure that buttons that mutate the buffer
are never side by side.
2024-03-17 08:04:13 -07:00
Kartik K. Agaram c413f281cf add to list of forks 2024-03-16 09:30:18 -07:00
Kartik K. Agaram bfc1f80b87 no, go back to drawing the menu after the editor
I originally made this change to keep the next/prev buttons from
overwriting the search bar. But now the dropdown menu up top gets
overwritten by the scrollbars! You can only see it if the window width
is just right, as happens on my phone.

I could fix this perfectly, but at the cost of some code complexity.
Just take that slight visual ugliness for now, it doesn't seem to impede
anything.
2024-03-14 10:19:27 -07:00
Kartik K. Agaram 08f3b08f0e draw code editor after menu and output
scenario:
* run Carousel on a computer
* press ctrl+f

Before this commit, the search dialog that came up was occluded by the
output editor's scrollbar.
2024-03-12 23:08:07 -07:00
Kartik K. Agaram b710439890 Merge template-live-editor-mobile 2024-03-10 22:32:25 -07:00
Kartik K. Agaram 7fab028c1e Merge template-live-editor 2024-03-10 22:28:20 -07:00
Kartik K. Agaram 8d3bfa6ba0 stop recommending the terminal
Freewheeling apps have been stable for many months now.
2024-03-10 22:25:28 -07:00
Kartik K. Agaram 960380b880 Merge template-live-editor-mobile 2024-03-10 21:46:51 -07:00
Kartik K. Agaram 5de5cdaf11 Merge template-live-editor 2024-03-10 21:41:58 -07:00
Kartik K. Agaram 01efe059a3 Merge text0 2024-03-10 21:41:24 -07:00
Kartik K. Agaram b281b3ddf4 Merge text.love 2024-03-10 21:40:10 -07:00
Kartik K. Agaram 732ae69382 Merge lines.love 2024-03-10 21:36:01 -07:00
Kartik K. Agaram 093da1e7f8 add a mirror and reorg mirrors 2024-03-10 20:15:46 -07:00
Kartik K. Agaram c7a81906cc slightly shrink the clickable area for a button
The reason is tooltips for buttons that lie along the left or bottom
edge of the app window. Since adding tooltips I noticed that the tooltip
on the 'next' button (which lies all down the right margin of the
window) would continue to be visible after the mouse moves off the
window. It turns out that LÖVE doesn't disable the mouse position
somehow after it goes off screen. It just remains at 0 or width-1 or
height-1.

Why was I not seeing the same issue with the 'previous' button? Kinda by
happy accident. The checks in button.lua were comparing using < and >,
not <= or >=. And the x coordinate when the mouse goes off window is 0.

So the quick solution is to remove one px of clickable area from the
bottom and right. It doesn't seem too hacky; the icon switches to
resizing the window anyway when you're _right_ at the border.

I'm also focusing now on the fact that pixel values in LÖVE go from 0 to
width-1 in spite of Lua's 1-based indexing in most places.
2024-02-23 15:23:28 -08:00
Kartik K. Agaram 3293f3e139 some keyboard shortcuts on non-mobile devices
Hopefully this is easy to remember from left to right:
- run is F1
- stop is F2
- hide/show is F3
- save is F4
- load is F5

There are also tooltips to introduce these shortcuts to newcomers.

Most of the shortcuts are only enabled when code is visible. In keeping
with existing conventions for mouse events, we leave most event handlers
for the script when code is hidden. The only exception is 'F3' to show
code. So if you want to use a shortcut 'k' when code is hidden, you have
to instead use 'F3 k F3'.

This is all tentative and open to change. But I'll probably grow more
reluctant to change the shortcuts in a few weeks or months.
2024-02-22 18:27:39 -08:00
Kartik K. Agaram 7232de5b2e missed a call 2024-02-21 13:10:26 -08:00
Kartik K. Agaram 84b9169337 extract functions for computing editor dimensions
Thanks Ryan for the suggestion.
2024-02-21 12:58:38 -08:00
Kartik K. Agaram 56268f09a4 add keyboard shortcuts for common operations 2024-02-21 06:45:37 -08:00
Kartik K. Agaram e81d371d87 support a resize handler 2024-02-18 21:11:30 -08:00
Kartik K. Agaram 17ef130938 Merge template-live-editor-mobile 2024-02-16 21:35:26 -08:00
Kartik K. Agaram 8bbb0dfef1 Merge template-live-editor 2024-02-16 21:34:15 -08:00
Kartik K. Agaram ff0d64390c Merge text0 2024-02-16 21:33:22 -08:00
Kartik K. Agaram 5fd7f01fab Merge text.love 2024-02-16 21:32:40 -08:00
Kartik K. Agaram 28aac52235 Merge lines.love 2024-02-16 21:28:08 -08:00
Kartik K. Agaram 219ee11686 ensure tapping on editor brings up soft keyboard 2024-02-16 21:16:29 -08:00
Kartik K. Agaram b510b14c11 'run_screen' for loading one screen from another
Thanks Ryan for the idea.
2024-02-15 20:46:21 -08:00
Kartik K. Agaram 4720fc75d5 Merge template-live-editor-mobile 2024-02-08 03:00:50 -08:00
Kartik K. Agaram 74f2d571e9 Merge template-live-editor 2024-02-08 02:58:59 -08:00
Kartik K. Agaram 7740beab74 Merge text0 2024-02-08 02:58:10 -08:00
Kartik K. Agaram 58c01172d3 Merge text.love 2024-02-08 02:57:30 -08:00
Kartik K. Agaram 6b33c9e223 Merge lines.love 2024-02-08 02:52:55 -08:00
Kartik K. Agaram 4e9298dda1 bugfix in cursor positioning
scenario:
- create a long wrapping line
- tap past end of first screen line

Before this commit the cursor would be positioned not quite at the end
of the screen line but one character before. In effect there was no way
to position cursor at end of a wrapping line.

I'm not sure how this bug has lasted so long. It was introduced in
commit 8d3adfa36 back in June 2022, which was itself billed as a bugfix
for "clicking past end of screen line". But when I go back to it this
bug exists even back then. How did I miss it?! I wrote a test back then
-- and the test was wrong, has always been wrong.
2024-02-08 02:37:12 -08:00
Kartik K. Agaram 5b5d3de6d9 provide a place to set the font
Thanks Ryan Kessler for suggesting this accessibility improvement.
2024-02-06 14:56:53 -08:00
Kartik K. Agaram 9aea053dd1 Merge template-live-editor-mobile 2024-02-04 17:52:11 -08:00
Kartik K. Agaram df2e2eebd2 Merge template-live-editor 2024-02-04 17:47:05 -08:00
Kartik K. Agaram e3124760b1 Merge text0 2024-02-04 17:45:48 -08:00
Kartik K. Agaram 01a13715d7 Merge text.love 2024-02-04 17:43:28 -08:00
Kartik K. Agaram 77e1b57446 Merge lines.love 2024-02-04 17:36:01 -08:00
Kartik K. Agaram 1dbd734abb fix yet another place 2024-02-04 17:19:39 -08:00
Kartik K. Agaram 95be13f9db more realism in one more helper 2024-02-04 17:15:35 -08:00
Kartik K. Agaram 83722db5e4 bugfix: don't clear selection on M-arrow
We now treat all arrow chords as cursor movement.

Many thanks to Ryan Kessler (https://tone.support) for reporting this
issue.
2024-02-04 09:31:36 -08:00
Kartik K. Agaram 1d1a829d5b more carefully pass the 'key' arg around 2024-02-04 09:30:48 -08:00
Kartik K. Agaram cda2d45b27 Merge template-live-editor-mobile 2024-01-31 15:27:03 -08:00
Kartik K. Agaram ea9d6dd85f Merge template-live-editor 2024-01-31 15:11:56 -08:00
Kartik K. Agaram 0477988406 new mirror 2024-01-30 23:43:15 -08:00