heynote icon indicating copy to clipboard operation
heynote copied to clipboard

Created and updated times

Open mlshapiro opened this issue 8 months ago • 4 comments

Add created/updated timestamps to block delimiter (#30)

New delimiter format with -c for created time and -u for updated time with ISO strings following (YYYY-MM-DDTHH:mm:ssZ)

\n∞∞∞(${languageTokensMatcher})(-a)?(-c${timeMatcher})?(-u${timeMatcher})?\n

Presents the updated time in the status bar:

image

mlshapiro avatar Dec 23 '23 18:12 mlshapiro

If this is headed in the right direct, i can keep going

I think so 👍! It was a while since I messed with the Lezer stuff, and the Lezer code in Heynote is the full extent of my experience with it, so I'm certainly not an expert when it comes to the grammar syntax.

heyman avatar Dec 23 '23 23:12 heyman

A thought that popped up in my mind when thinking about this.. I think it would be a good idea to investigate how we could implement the actual updating of the timestamps in the Codemirror text buffer. I'm guessing that this should be done with some kind of transactionFilter, but the text in the reference manual seems to indicate that it might not be a very good idea. So it's probably smart to investigate that to make sure it's not a showstopper due to performance issues or similar.

heyman avatar Dec 24 '23 00:12 heyman

We would only need a transactionFilter to update the update times with every change. So it even if it turns out that it's a showstopper, it shouldn't prevent us from adding creation time.

heyman avatar Dec 25 '23 01:12 heyman

@heyman this is "ready to go" but I'm having trouble solving two (known) bugs:

  1. When I "Select All" (twice) to get the whole scratch pad, and then "delete", I'm left with 2 blocks, not one. I can't fingure out why the defaultSelectAll doesn't actually select all the buffer text.
  2. I can't get certain language-detection.spec.js tests to pass. When I debug the tests, the .pressSequentially(... command types in the text and then ends up in an infinite loop of creating new blocks. I can't figure out where this is coming from and whether the bug is in the test or application side.

Any insight on either?

mlshapiro avatar Jan 02 '24 21:01 mlshapiro