Skip to content
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
merged 6 commits into from
Jul 9, 2024
Merged

Migrate to the new LinkAnnotation API #425

merged 6 commits into from
Jul 9, 2024

Conversation

hamen
Copy link
Collaborator

@hamen hamen commented Jul 2, 2024

Overview

  • Introduced LinkAnnotation.Clickable to drive the behavior of links
  • Replaced SimpleClickableText with the good ol' Text
  • Successfully wired onUrlClick and onTextClick lambdas and the enabled flag.

Tests

Manually tested on Windows 11 using the Markdown example as a standalone application and the IDE plugin showcase.

Closes #418

hamen added 4 commits July 2, 2024 12:52
* 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
@hamen hamen requested a review from rock3r July 2, 2024 16:37
@hamen hamen added the maintenance Rote maintenance tasks (e.g., dependency updates) label Jul 2, 2024
@rock3r rock3r added the markdown This issue impacts the Markdown rendering subsystem label Jul 4, 2024
hamen added 2 commits July 8, 2024 12:30
When links are disabled, we show something that looks like a link,
but it's not clickable and has no 👆 pointer icon.
@rock3r rock3r merged commit 08970fe into main Jul 9, 2024
13 checks passed
@rock3r rock3r deleted the im-418 branch July 9, 2024 10:49
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use new Links API in Markdown
2 participants