Skip to content

Mark autocomplete#377

Open
platers wants to merge 25 commits intoWuTheFWasThat:masterfrom
platers:autocomplete
Open

Mark autocomplete#377
platers wants to merge 25 commits intoWuTheFWasThat:masterfrom
platers:autocomplete

Conversation

@platers
Copy link
Copy Markdown
Contributor

@platers platers commented Apr 1, 2021


Capture

Adds an autocomplete menu when creating mark links. Navigate with up, down, and enter.

@WuTheFWasThat
Copy link
Copy Markdown
Owner

nice, could you resolve conflicts? will test it out sometime when i get a chance!

Comment thread src/assets/ts/components/line.tsx Outdated
wordHook?: PartialUnfolder<Token, React.ReactNode>;
onCharClick?: ((col: Col, e: Event) => void) | undefined;
cursorBetween?: boolean;
session?: Session;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be better to not have the Session abstraction here and just pass in something like

renderLineAnnotationHook?: (info: { lineData: .., column: ..., cursors: ...}) => Array<React.ReactNode>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it working that way, but I had to bind the session to the function. Does that defeat the purpose? Genuinely curious exactly why this way is cleaner.

Copy link
Copy Markdown
Owner

@WuTheFWasThat WuTheFWasThat Apr 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, fine to bind the session to the function from the caller. i don't know if it really matters, was just going broadly by the principle of requiring less abstractions in interfaces :)

for example if you wrote a unit test for line.tsx it would be maybe annoying if you had to construct a session object to test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, thanks for explaining!

Comment thread src/plugins/marks/index.tsx Outdated
@platers
Copy link
Copy Markdown
Contributor Author

platers commented Apr 10, 2021

I think it will be better to implement this as a mode, will update this later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants