-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to the new LinkAnnotation API #425
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Replace deprecated UrlAnnotation with LinkAnnotation
* Introduced LinkAnnotation.Clickable to drive the behaviour of links * Replaced SimpleClickableText with the good ol' Text * Successfully wired onUrlClick and onTextClick lambdas and the enabled flag. Closes #418
rock3r
reviewed
Jul 3, 2024
...core/src/main/kotlin/org/jetbrains/jewel/markdown/rendering/DefaultInlineMarkdownRenderer.kt
Show resolved
Hide resolved
...core/src/main/kotlin/org/jetbrains/jewel/markdown/rendering/DefaultInlineMarkdownRenderer.kt
Outdated
Show resolved
Hide resolved
...lone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/markdown/MarkdownPreview.kt
Outdated
Show resolved
Hide resolved
When links are disabled, we show something that looks like a link, but it's not clickable and has no 👆 pointer icon.
rock3r
reviewed
Jul 8, 2024
...core/src/main/kotlin/org/jetbrains/jewel/markdown/rendering/DefaultInlineMarkdownRenderer.kt
Show resolved
Hide resolved
rock3r
approved these changes
Jul 9, 2024
...core/src/main/kotlin/org/jetbrains/jewel/markdown/rendering/DefaultInlineMarkdownRenderer.kt
Show resolved
Hide resolved
rock3r
added a commit
that referenced
this pull request
Jul 18, 2024
We weren't using the TextLinkStyles provided by the LinkAnnotation API, and as a result, our links weren't stateful. We were also not properly setting a disabled colour — now we do. Also changed, we force the Markdown text to not be focusable, even if it is clickable, since we don't want it to get focused. Now only links are focused while tabbing through Markdown. This also removes some testing harness left around from #425, and that we don't need anymore. Note: links should have a border around them when they are focused, but that's not possible with the Compose APIs. What we do instead is show a subtle background color, taken from the ActionButtons' hover and pressed states, for our focused and pressed states, respectively.
rock3r
added a commit
that referenced
this pull request
Jul 18, 2024
We weren't using the TextLinkStyles provided by the LinkAnnotation API, and as a result, our links weren't stateful. We were also not properly setting a disabled colour — now we do. Also changed, we force the Markdown text to not be focusable, even if it is clickable, since we don't want it to get focused. Now only links are focused while tabbing through Markdown. This also removes some testing harness left around from #425, and that we don't need anymore. Note: links should have a border around them when they are focused, but that's not possible with the Compose APIs. What we do instead is show a subtle background color, taken from the ActionButtons' hover and pressed states, for our focused and pressed states, respectively.
rock3r
added a commit
that referenced
this pull request
Jul 18, 2024
We weren't using the TextLinkStyles provided by the LinkAnnotation API, and as a result, our links weren't stateful. We were also not properly setting a disabled colour — now we do. Also changed, we force the Markdown text to not be focusable, even if it is clickable, since we don't want it to get focused. Now only links are focused while tabbing through Markdown. This also removes some testing harness left around from #425, and that we don't need anymore. Note: links should have a border around them when they are focused, but that's not possible with the Compose APIs. What we do instead is show a subtle background color, taken from the ActionButtons' hover and pressed states, for our focused and pressed states, respectively.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
maintenance
Rote maintenance tasks (e.g., dependency updates)
markdown
This issue impacts the Markdown rendering subsystem
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Tests
Manually tested on Windows 11 using the Markdown example as a standalone application and the IDE plugin showcase.
Closes #418