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

[LiquidDoc] Prevent rendering of hover tooltip for snippets with no renderable content #729

Open
wants to merge 3 commits into
base: jm/param_hover
Choose a base branch
from

Conversation

jamesmengo
Copy link
Contributor

@jamesmengo jamesmengo commented Jan 23, 2025

What are you adding in this PR?

{% render 'snippet' %}

Prevents rendering hover tooltip for snippets that:

  • do not exist
  • do not have renderable content.

Renderable content: Currently, this means that it requires a LiquidDoc definition with @param annotations, though this will soon expand to the description and @example as well

Before you deploy

  • This PR includes a new checks or changes the configuration of a check
    • I included a minor bump changeset
    • It's in the allChecks array in src/checks/index.ts
    • I ran yarn build and committed the updated configuration files
      • If applicable, I've updated the theme-app-extension.yml config
  • I included a minor bump changeset
  • My feature is backward compatible
  • I included a patch bump changeset

Copy link
Contributor Author

jamesmengo commented Jan 23, 2025

@jamesmengo jamesmengo changed the title [LiquidDoc] Return undefined for invalid snippet definitions Stop rendering hover toolbox Jan 23, 2025
@jamesmengo jamesmengo changed the title Stop rendering hover toolbox Prevent rendering of hover tooltip for nonexistent snippets Jan 23, 2025
@jamesmengo jamesmengo force-pushed the jm/prevent_hover_nonexistent_snippets branch from 6ad37f6 to 1f7a561 Compare January 23, 2025 02:09
@jamesmengo jamesmengo changed the title Prevent rendering of hover tooltip for nonexistent snippets Prevent rendering of hover tooltip for snippets with no renderable content Jan 23, 2025
@jamesmengo jamesmengo changed the title Prevent rendering of hover tooltip for snippets with no renderable content [LiquidDoc] Prevent rendering of hover tooltip for snippets with no renderable content Jan 23, 2025
@jamesmengo jamesmengo marked this pull request as ready for review January 23, 2025 02:26
@jamesmengo jamesmengo requested a review from aswamy January 23, 2025 02:27
@jamesmengo jamesmengo requested review from a team and removed request for aswamy January 23, 2025 02:27
@jamesmengo jamesmengo self-assigned this Jan 23, 2025
Copy link
Contributor Author

@charlespwd Branching off of this comment for snippets without a liquidDoc definition, what is some valuable content we can render here?

Is there value in rendering the below?

image.png

@charlespwd
Copy link
Contributor

I mean... your opinion is as good as mine? Maybe would be better to add something that points to the snippet file in the description?

Ideally we'd be able to differentiate between something that exists vs something that does not exist. But there's the theme check for that so 🤷

@jamesmengo
Copy link
Contributor Author

Snippet exists, but no liquidDoc

image

Snippet does not exist

image

  • Renders a red squiggly + warning via theme check

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.

4 participants