boltex / leojs

Leo Literate Editor with Outline in Typescript
https://marketplace.visualstudio.com/items?itemName=boltex.leojs
MIT License
25 stars 1 forks source link

Add the UUID/KSUID gnx string generation capabilities #42

Closed kghenderson closed 7 months ago

kghenderson commented 1 year ago

one of the things that keeps me from using at-file nodes (i.e. with sentinels), is the lack of customization for the node identity's. i'm aware that this came up a long time ago for leo proper and the issue was shut down (so i was forced to stop using them).

what i'd very much prefer to use are perhaps: KSUID = K-Sortable Unique IDentifier. a globally unique id that also sorts correctly by time. https://github.com/segmentio/ksuid

there are other options of course, but i work on a team and i really don't like/can't have my username and timestamp as the identifier. but ksuid's could even be used across applications.

ideally we could even alias these nodes so that named '#region' references could also/instead be used for imports.

i have much more to say on this, but this is/was one of my major pain points with leo.

thanks for considering.

ksuid background: https://segment.com/blog/a-brief-history-of-the-uuid/ python lib example: https://pypi.org/project/svix-ksuid/
edreamleo commented 1 year ago

On Wed, Jan 11, 2023 at 9:00 AM Kevin Henderson @.***> wrote:

one of the things that keeps me from using at-file nodes (i.e. with sentinels), is the lack of customization for the node identity's. i'm aware that this came up a long time ago for leo proper and the issue was shut down (so i was forced to stop using them).

I am so glad you are raising this issue.

Back in September of last year spikethehobbit https://github.com/spikethehobbitmagesubmitted PR #2843 https://github.com/leo-editor/leo-editor/pull/2843. I initially rejected this PR due to compatibility concerns.

Later I changed my mind, realizing that the OP had fully analyzed the effect of the changes:

QQQ Older versions of Leo (as far back as 4.1 when the current gnx format was introduced) can read and write such files without difficulty and will simply ignore the new setting. AFAICT the only impact is to the ToDo plugin, which will be unable to determine when a UUID node was created. It handles this situation gracefully but the "sort by creation date" feature won't work with UUID nodes. QQQ

I tried to apologize about my initial decision but got no response. Not one of my better managerial moments.

what i'd very much prefer to use are perhaps: KSUID = K-Sortable Unique IDentifier. a globally unique id that also sorts correctly by time. https://github.com/segmentio/ksuid

there are other options of course, but i work on a team and i really don't like/can't have my username and timestamp as the identifier. but ksuid's could even be used across applications.

ideally we could even alias these nodes so that named '#region' references could also/instead be used for imports.

i have much more to say on this, but this is/was one of my major pain points with leo.

Interesting. What would you like to do next? Would PR #2843 https://github.com/leo-editor/leo-editor/pull/2843 work for you, or would you prefer to submit another PR?

Edward

kghenderson commented 1 year ago

^ thank you so much Edward, my sincerest apologies for not responding then, these have been some tumultuous years :-) I'll have a look at that PR.

edreamleo commented 1 year ago

On Wed, Jan 11, 2023 at 9:41 AM Kevin Henderson @.***> wrote:

^ thank you so much Edward, my sincerest apologies for not responding then, these have been some tumultuous years :-)

Oh! So you're spike? Apology accepted. Glad we are back on track.

Edward

kghenderson commented 1 year ago

lol, at first i thought you meant spike as in spike-protein (covid) and had a chuckle, but i think you mean spikethehobbit, i.e. the author of that change .... no, i'm not spikethehobbit, just a regular user :-/ this was me bringing up the issue a few years ago: https://groups.google.com/g/leo-editor/c/g-Dl-g4S13s/m/xQENrBO4BQAJ

edreamleo commented 1 year ago

@kghenderson :-) So I'll repeat my question. Will PR #2843 work for you or would you like to try your hand at a new PR?

Let's continue our discussion at Leo #3047.

boltex commented 1 year ago

@kghenderson @edreamleo I've got no objection to porting this feature to leojs

I'll keep an eye on Leo's issue #3047 and i'll close this one in leojs once it's also part of leojs.