-
-
Notifications
You must be signed in to change notification settings - Fork 493
feat: changelog - formatted links, more git providers & copy markdown #2983
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
Open
WilcoSp
wants to merge
299
commits into
npmx-dev:main
Choose a base branch
from
WilcoSp:changelog/format-link+git-providers+copy-markdown
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
299 commits
Select commit
Hold shift + click to select a range
4de0348
removing unneeded comment
WilcoSp 5f4520f
removing resolving explicitly ./ & ../ comment
WilcoSp 81f68b6
Merge branch 'main' into feat/changelog-1
WilcoSp 6d0edfd
[autofix.ci] apply automated fixes
autofix-ci[bot] f9c0736
adding view_on translation to kn_IN (autofix removed it)
WilcoSp d48654a
Merge branch 'main' into feat/changelog-1
WilcoSp a67f039
Merge branch 'main' into feat/changelog-1
WilcoSp 08828b8
adding ogImage to package changes page
WilcoSp 5f1be8a
fixed version selector by adding latestVersion
WilcoSp d71dfd9
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp 503b4df
for releases the date is now being used to send you as close as possi…
WilcoSp cfc8612
removing unused pending variable
WilcoSp e2fc2d2
removing console log
WilcoSp 47431f5
switching from encodeURIComponent to encodeURI for changelog card navid
WilcoSp c43514b
Merge branch 'main' into feat/changelog-1
WilcoSp ef72002
disableling ogImage for package changes page as it has been changed a…
WilcoSp 886dd9f
Merge branch 'main' into feat/changelog-1
WilcoSp 40e8f2b
[autofix.ci] apply automated fixes
autofix-ci[bot] 299b45c
adding view_on to fr_TR
WilcoSp 2de6f9f
Merge branch 'main' into feat/changelog-1
WilcoSp 6915b33
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp 89cae7e
for releases now also matching on version in release title for scrolling
WilcoSp bdcf1a7
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp 133aa39
now also matching to version with changelog.md
WilcoSp ce053be
Merge branch 'main' into feat/changelog-1
WilcoSp 8b5311c
added better checks/detecting for monorepos using changelog.md
WilcoSp eb96164
Merge branch 'main' into feat/changelog-1
WilcoSp 7c99b43
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp ddd4121
ensuring toc will always be at the end for changelog
WilcoSp bb8b09f
Merge branch 'main' into feat/changelog-1
WilcoSp fabc65d
Merge branch 'main' into feat/changelog-1
WilcoSp 443341b
moved slugify to `shared/utils/html.ts` to allow usage in the front &…
WilcoSp c54c406
changelog page now using useViewOnGitProvider
WilcoSp 267880f
Merge branch 'main' into feat/changelog-1
WilcoSp 9427f0f
Merge branch 'main' into feat/changelog-1
WilcoSp 94f2571
Merge branch 'main' into feat/changelog-1
WilcoSp 43306af
Merge branch 'main' into feat/changelog-1
WilcoSp 41e395f
added changelog to packageHeader & switched changelog to use the pack…
WilcoSp aaea9ee
showing skeleton loaders for changelog.
WilcoSp 327dd42
fixed height for sticky header changelog
WilcoSp 6d140ab
n in 5 -> _n of 5 due to type check
WilcoSp a9d09b3
Merge branch 'main' into feat/changelog-1
WilcoSp 96bf944
removing docsLink, earlier merge hadn't removed it
WilcoSp 04b2c21
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp 7da82ae
skeleton loaders are now being displayed when loading the releases/ma…
WilcoSp 850e5c8
..
WilcoSp c1e91e9
fixed going to latest & changed going to has to only client side
WilcoSp 609395e
moved from [...path] -> [[org]]/[name] ....
WilcoSp 314d49f
the version will now be resolved like on the package page so no more …
WilcoSp a9d9802
fixed issue to where the prev version was jumped to while resolving v…
WilcoSp dcbbdac
the sticky header is now always one with toc instead of github
WilcoSp f7377d5
fixed missing tocHeaderClass in a11y tests
WilcoSp 732268d
added the shortcut for 'm' & '-'
WilcoSp 0c441b2
..
WilcoSp 435b569
Merge branch 'main' into feat/changelog-1
WilcoSp f3c1759
changelog will tab will always be visible when on changelog page
WilcoSp c0f3c44
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp 6757ae0
Merge branch 'main' into feat/changelog-1
WilcoSp c77f335
fix: use idPrefix for release in resolveUrl
WilcoSp fcacad8
removing target when url doesn't have protocol (for example when poin…
WilcoSp 21a7d5f
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp 5180309
Merge branch 'main' into feat/changelog-1
WilcoSp 9d7aff1
Merge branch 'main' into feat/changelog-1
WilcoSp 2d9609c
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp 5630b1c
applying most changes recommended from review (thanks alexdln)
WilcoSp a2e0c16
Merge branch 'main' into feat/changelog-1
WilcoSp 22ccc27
fixing ci issues
WilcoSp 85e2cb0
changed the watch to watcheffect for navigating to the specific version
WilcoSp 172f758
moved changelog routing from 'changes' -> 'changelog'
WilcoSp acea1fd
detecting now when ungh.cc has exhausted it's api keys
WilcoSp 246fc86
added error message when ungh's api keys are exhausted
WilcoSp 07c28a9
preparing merging with main
WilcoSp ee38fbd
Merge branch 'main' into feat/changelog-1
WilcoSp f9475fd
updated i18n schema
WilcoSp b93bf44
switch to nuxtError due to ci issues
WilcoSp 78ba6f7
..
WilcoSp e70f094
Merge branch 'main' into feat/changelog-1
WilcoSp ddddc63
Merge branch 'main' into feat/changelog-1
ghostdevv 9036e81
Merge branch 'main' into feat/changelog-1
WilcoSp 479a1c4
Merge branch 'main' into feat/changelog-1
WilcoSp 52151ba
fixing things the merge broke
WilcoSp 2ff9374
added 429 to detect key exhaustion
WilcoSp b512aea
fixed schema for ci
WilcoSp 2a439b4
Merge branch 'main' into feat/changelog-1
WilcoSp 9caf56b
..
WilcoSp ee5e892
Merge branch 'main' into feat/changelog-1
WilcoSp 5e6ee46
changed how the ::after icon is unset for changelog
WilcoSp 3a86ab8
Merge branch 'main' into feat/changelog-1
WilcoSp 44fffff
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp 4433716
added padding to changelog markdown component
WilcoSp 22901bc
[autofix.ci] apply automated fixes
autofix-ci[bot] ef51c3d
Merge branch 'main' into feat/changelog-1
WilcoSp 200d861
adding flush post, this should hopefully make the auto scrolling more…
WilcoSp d8f7ed0
reverted lazyChangelogCard & hydrate-on-interaction because auto scro…
WilcoSp 66f2de2
..
WilcoSp 9714514
added index.vue for changelog which did fix some issues
WilcoSp 3ff1c44
adding french translation for changelog (thanks @WarningImHack3r / An…
WilcoSp 3cec9bd
Merge branch 'main' into feat/changelog-1
WilcoSp edd7541
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp 07eadba
made it that the anchor link for heading in readme is visible over th…
WilcoSp d15e2e9
resolving version now happens in the background when switching versio…
WilcoSp d35024f
..
WilcoSp 41e68b5
added translation for "version_unavailable", thanks @WarningImHack3r…
WilcoSp 2faf5ec
Merge branch 'main' into feat/changelog-1
WilcoSp 67cb175
fixed schema
WilcoSp 82c6a38
[autofix.ci] apply automated fixes
autofix-ci[bot] f983c39
Merge branch 'main' into feat/changelog-1
WilcoSp a4f7218
fix ci
WilcoSp 7715d63
Merge branch 'main' into feat/changelog-1
WilcoSp eee5965
Merge branch 'main' into feat/changelog-1
WilcoSp 001f54e
removing merge artifact
WilcoSp d4bce55
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp 17d570e
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp 3be30b1
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp dca8094
updated command pallet to include changelog
WilcoSp 73dd529
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp aa2a894
refined the routing for the changelog info api & latest will now only…
WilcoSp 68777c9
Merge branch 'main' into feat/changelog-1
WilcoSp 2076078
translated changelog text to Dutch + code_ligatures, githubStars, git…
WilcoSp 07b1caa
moved codeHightlight, blockqoute and some other things
WilcoSp 3e8276c
links have been moved to mdKit
WilcoSp c8d8027
Merge branch 'main' into feat/changelog-1
WilcoSp 39e2035
heading is now being shared, not happy yet with how id is being done yet
WilcoSp 564506f
..
WilcoSp 757b0d1
Merge branch 'main' into feat/changelog-1
WilcoSp 17cf46e
added 1 for timelink link & correct npm-register translations for Dutch
WilcoSp abe8870
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp 04a79ed
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp e53d289
currently changed ogImage for changelog to the one for Page, it would…
WilcoSp c51b977
Merge branch 'main' into feat/changelog-1
WilcoSp aef1dc9
Merge branch 'feat/changelog-1' into feat/markdown-kit
WilcoSp 267f6f0
the handling of anchors in headings is now more consistent, when <a> …
WilcoSp f4db624
moved handling of html heading+link & the heading extension for marke…
WilcoSp 1432806
corrected test description to new behavior
WilcoSp 48938cc
Merge branch 'main' into feat/changelog-1
WilcoSp 4a6349f
..
WilcoSp 0dafd12
Merge branch 'main' into feat/changelog-1
WilcoSp 8d24e10
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp 3d1c449
og image, fixed the title
WilcoSp cdf3cac
moved image to mdkit & starting with moving sanitizeHtml
WilcoSp 02efe38
completed sanitizeRawHTML
WilcoSp 60cc71c
Merge branch 'feat/changelog-1' into feat/markdown-kit
WilcoSp 6e93052
fixed not adding # for changelog md, added missing import
WilcoSp d5404ef
moved decodeHashFragment to mdkit to allow changelog to also use it
WilcoSp 8b73585
adding back comment for anchor sanitization
WilcoSp 57709ba
handling html heading better for changelog.md
WilcoSp 1dc18db
starting with making tests for changelog's markdown renderer
WilcoSp fe161e9
fixed issue resolving relative urls
WilcoSp 50f498f
Merge branch 'feat/changelog-1' into feat/markdown-kit
WilcoSp b397900
all route variants are now being tested
WilcoSp 4d82191
now correctly fixed resolving path
WilcoSp 31daed5
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp 1692657
fixed resolving npmjs -> npmx url for changelog
WilcoSp 7a6ea88
..
WilcoSp 2726303
fixing resolving npmjs -> npmx urls
WilcoSp 8a5eb66
Merge branch 'feat/changelog-1' of github.com:WilcoSp/npmx.dev into f…
WilcoSp 38696ef
Merge branch 'feat/changelog-1' into feat/markdown-kit
WilcoSp 2739315
..
WilcoSp e7b1254
added tests for correct heading level & fixed heading level starting …
WilcoSp c7340c0
added test for package@version
WilcoSp fdb0c9f
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp a9e7e4a
Merge branch 'feat/changelog-1' into feat/markdown-kit
WilcoSp 48a9f4e
Merge branch 'main' into feat/changelog-1
WilcoSp 771aa74
Merge branch 'npmx-dev:main' into feat/changelog-1
WilcoSp 0d4e14e
Merge branch 'feat/changelog-1' into feat/markdown-kit
WilcoSp 1e6a73b
Merge branch 'feat/markdown-kit' of github.com:WilcoSp/npmx.dev into …
WilcoSp 891e90b
fixed matching more exacter the requested version for changelog.md
WilcoSp ed22222
Merge branch 'main' into feat/changelog-1
WilcoSp 727dbae
fix remove whatsapp og image
WilcoSp 9b49528
Merge branch 'feat/changelog-1' into feat/markdown-kit
WilcoSp 78264c5
fixed text -> application for json mime type
WilcoSp 52cc1f9
Merge branch 'main' into feat/changelog-1
WilcoSp ccbac72
fix type mime type json at usePackageChangelog
WilcoSp 94c243f
Merge branch 'feat/changelog-1' into feat/markdown-kit
WilcoSp 3cf1c84
Merge branch 'main' into feat/markdown-kit
WilcoSp 7a6ed94
applied suggested changes (except for command pallette)
WilcoSp e3bafc5
fixed bug to which command pallette caused changelog not being fetch …
WilcoSp f504d2f
Merge branch 'npmx-dev:main' into feat/markdown-kit
WilcoSp 4e23226
changed has changelog key
WilcoSp 932dbce
moved skeleton layout to it's own component
WilcoSp 11acac8
Merge branch 'npmx-dev:main' into feat/markdown-kit
WilcoSp 225f8b9
fixed some issues found by code rabbit
WilcoSp 4e65ff8
Merge branch 'feat/markdown-kit' of github.com:WilcoSp/npmx.dev into …
WilcoSp c335353
updated tests to include the aria-hidden & tabindex
WilcoSp 568acc2
adding link at changelogCard to view the release on github (& future …
WilcoSp b4b09b3
fixed missing things
WilcoSp fec1a02
removing suspense comments
WilcoSp 51e8175
Merge branch 'main' into feat/markdown-kit
WilcoSp 6918716
Merge branch 'main' into feat/markdown-kit
WilcoSp e8538fd
changed ungh.cc files to raw.githubusercontent to prevent any api cha…
WilcoSp 9ede482
changelog.md & releases from forgejo/codeberg can now be detected
WilcoSp 4ef1d58
fix: adding useProviderIcon to the include list for unocss
WilcoSp 5d602de
fixed type weekelijkse -> wekelijkse
WilcoSp 4487bc1
src -> ** (rabbit)
WilcoSp cfbd690
Merge branch 'feat/markdown-kit' into feat/changelog-forgejo
WilcoSp 25c6750
codeberg/forgeje releases & changelog.md can now also be viewed
WilcoSp f53bc2b
adding singlular form for deps increase/decrease for NL
WilcoSp 91e784a
Merge branch 'main' into feat/markdown-kit
WilcoSp 57caab4
Merge branch 'feat/markdown-kit' of github.com:WilcoSp/npmx.dev into …
WilcoSp 93a14a2
adding recent translations to Dutch
WilcoSp acdf8f8
changed the return for checkingReleases to a tuple safe return type
WilcoSp 51c0587
removing test in schema
WilcoSp b05b46f
isError to instanceof
WilcoSp 75485d7
Merge branch 'main' into feat/markdown-kit
WilcoSp e17e8bd
Merge branch 'main' into feat/markdown-kit
WilcoSp a2e52fd
Merge branch 'npmx-dev:main' into feat/markdown-kit
WilcoSp 7766c7b
fixed issue where issues/PRs were being turned into headings if they …
WilcoSp 2d76d06
fixed issue where readme global marked overwrote heading extension fo…
WilcoSp 5cb8ef3
Merge branch 'main' into feat/markdown-kit
WilcoSp 89e0cc5
moved the markedInstance into the renderToRawHtml param object
WilcoSp b45e270
Merge branch 'feat/markdown-kit' of github.com:WilcoSp/npmx.dev into …
WilcoSp 16339ee
Merge branch 'feat/markdown-kit' into feat/changelog-forgejo
WilcoSp 8954ae0
Merge branch 'main' into feat/markdown-kit
WilcoSp 94a1617
resolving autoLinks for git reposities. for example /pull/1 -> #1
WilcoSp 9df9b45
pr, issues & accounts in plain text will now also be turned into links
WilcoSp bc0864f
commits will now also be matched to be created into a link
WilcoSp 8bfe917
Merge branch 'npmx-dev:main' into feat/markdown-kit
WilcoSp 004c212
Merge branch 'main' into feat/markdown-kit
WilcoSp c6ec916
Merge branch 'feat/markdown-kit' into feat/changelog-forgejo
WilcoSp f841604
added tests for plaintext -> link and unformatted/auto links to forma…
WilcoSp 580df00
fixed potential issue of formatting a issue/pr also into a commit
WilcoSp 6228cf2
Merge branch 'main' into changelog/format-link+git-providers+copy-mar…
WilcoSp f02e5ad
able to detect releases & changelog.md for gitlab
WilcoSp 67e2144
added support gitlab
WilcoSp 8613bdc
added suppot for tangled & optimized how the markdown file is gotten …
WilcoSp e1906fd
Merge branch 'npmx-dev:main' into changelog/format-link+git-providers…
WilcoSp e402553
added raw markdown endpoint for releases & allowing for the changelog…
WilcoSp dcdd0a1
moved the button to copy markdown to it's own component
WilcoSp ea1b19d
added the copy markdown button the the changelog markdown component
WilcoSp b3081ec
added copy markdow button to releases.
WilcoSp b14bc1f
expanded the account regex to allow for at proto handles for tangled
WilcoSp 2b4037c
added (missing) tests
WilcoSp f00834f
changed width to min width at the changelog card for the copy button …
WilcoSp 1cdd070
Merge branch 'main' into changelog/format-link+git-providers+copy-mar…
WilcoSp 8ee3e4a
..
WilcoSp 46093c2
Merge branch 'changelog/format-link+git-providers+copy-markdown' of g…
WilcoSp cfffcea
commits will now only show the first 7 digits
WilcoSp b50fe99
trying to debug why raw doesn't work on vercel
WilcoSp 0fe530c
seeing what the URL object gives from vercel
WilcoSp 56d2d99
disabled caching md route for debugging with vercel
WilcoSp c8e7e3a
added md & releases route to nuxt.config for vercel to be able to rec…
WilcoSp 4d504b1
Merge branch 'main' into changelog/format-link+git-providers+copy-mar…
WilcoSp 8d6eaa2
validating the host now
WilcoSp 2b3260e
tag will be re encoded where needed
WilcoSp 535dbdd
Merge branch 'changelog/format-link+git-providers+copy-markdown' of g…
WilcoSp c7b9443
fixing moving need host
WilcoSp b235cbf
sanatizing the output of createResolveGitTextToLinks.
WilcoSp 46dac96
root only also check without leading /
WilcoSp 9533791
added tests for validate host
WilcoSp e4893e7
fixed types & test
WilcoSp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| <script setup lang="ts"> | ||
| import type { AsyncDataRequestStatus } from '#app' | ||
|
|
||
| defineOptions({ | ||
| inheritAttrs: false, | ||
| }) | ||
|
|
||
| const { text, fetchMarkdown, markdown, status } = defineProps<{ | ||
| text: string | ||
| fetchMarkdown: () => Promise<void> | ||
| markdown: string | undefined | ||
| status: AsyncDataRequestStatus | ||
| }>() | ||
|
|
||
| function prefetchMarkdown() { | ||
| if (status === 'idle') { | ||
| fetchMarkdown() | ||
| } | ||
| } | ||
|
|
||
| const { | ||
| copied: copiedReadme, | ||
| copy, | ||
| copyPending: copyReadmePending, | ||
| } = useClipboard({ | ||
| copiedDuring: 2000, | ||
| }) | ||
|
|
||
| function copyMarkdown() { | ||
| copy(async () => { | ||
| if (status === 'idle' || status === 'pending') { | ||
| await fetchMarkdown() | ||
| } | ||
| return markdown ?? '' | ||
| }) | ||
| } | ||
|
|
||
| const btn = useTemplateRef('btn') | ||
|
|
||
| const hover = useElementHover(() => btn.value?.$el, { | ||
| // prevent fetching while moving the pointer | ||
| delayEnter: 300, | ||
| }) | ||
|
|
||
| const stopWatchHover = watch(hover, state => { | ||
| if (state) { | ||
| prefetchMarkdown() | ||
| stopWatchHover() | ||
| } | ||
| }) | ||
| </script> | ||
| <template> | ||
| <TooltipApp :text position="bottom"> | ||
| <ButtonBase | ||
| ref="btn" | ||
| @focus="prefetchMarkdown" | ||
| @click="copyMarkdown" | ||
| :aria-pressed="copiedReadme" | ||
| :aria-label="copiedReadme ? $t('common.copied') : text" | ||
| :classicon="copiedReadme ? 'i-lucide:check' : 'i-simple-icons:markdown'" | ||
| v-bind="$attrs" | ||
| > | ||
| <span>{{ copiedReadme ? $t('common.copied') : $t('common.copy') }}</span> | ||
| <span v-if="copyReadmePending" class="i-lucide:loader-circle animate-spin size-4"></span> | ||
| </ButtonBase> | ||
| </TooltipApp> | ||
| </template> | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: npmx-dev/npmx.dev
Length of output: 22845
🏁 Script executed:
Repository: npmx-dev/npmx.dev
Length of output: 21935
🌐 Web query:
VueUse useClipboard copy signature v14.3.0 source string async callback docs💡 Result:
In VueUse version 14.3.0, the useClipboard function provides a flexible copy mechanism that supports both static strings and asynchronous callbacks [1][2]. The copy function signature is: copy(value?: ClipboardValue) => Promise The ClipboardValue type allows the source to be either a string or an async function that returns a string [2]. Key details regarding the source and copy behavior in v14.3.0 include: 1. Handling of Sources: When calling copy, if no argument is provided, the function defaults to the source defined in the useClipboard options (which supports MaybeRefOrGetter) [3][1][2]. 2. Asynchronous Support: The implementation was updated in v14.3.0 (via PR
#5369) to better handle asynchronous operations, specifically addressing issues in Safari [4][5][2]. When providing an async function as the source, the copy method will await the resolved value before performing the clipboard write [2]. 3. Legacy Fallback: If the Clipboard API is unavailable or permission is denied, and legacy mode is enabled (legacy: true), the function handles both string values and asynchronous callbacks by resolving the async function, updating the text ref, and then executing a fallback copy (using document.execCommand) [1][2]. The return object of useClipboard includes the copy function, which is typed to return a Promise that resolves after the operation completes [1][6].Citations:
🏁 Script executed:
Repository: npmx-dev/npmx.dev
Length of output: 509
🏁 Script executed:
Repository: npmx-dev/npmx.dev
Length of output: 22933
Retry on fetch errors before copying markdown.
prefetchMarkdown()andcopyMarkdown()only fetch whenstatusisidle/pending, so a transient failure leaves the button unable to recover and it can keep copying stale/empty content. Allowstatus === 'error'to retry, or surface the failure instead.🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a toast/snackbar component/composable available for notifying when getting raw markdown failed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Length of output: 1935
@WilcoSp, I searched the codebase and didn't find an existing toast/snackbar component or composable — there's novue-sonner,vue-toastification, or similar library inpackage.json, and nothing underapp/components/(e.g.Tooltip/) implements toast-style notifications.A few options if you want to surface the fetch failure:
useToast()backed by a global reactive queue + aToast.vuerenderer mounted once in the layout) — reusable beyond this PR.Tooltipcomponent to show an inline "Failed to copy, try again" message on the button itself whenstatus === 'error', avoiding a new global UI primitive.aria-liveregion near the button for an accessible, unobtrusive text update on failure, which is the lowest-effort option and still addresses the retry/notify concern from my original comment.Given this PR's scope is already broad (per the earlier discussion about splitting it), option 2 or 3 might be the pragmatic choice for now, with a dedicated toast composable as a possible follow-up if similar needs arise elsewhere. Let me know which direction you'd like to take, or if you'd prefer to defer the failure-notification part of my comment altogether.
(=^・ω・^=)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there maybe something like an a11y announce function or composable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Length of output: 9143
@WilcoSpyes — there's already a global announce composable used elsewhere in the app:useCommandPalette()exposes anannounce(message: string)function (app/composables/useCommandPalette.ts, Line 89), backed by auseState('command-palette:announcement', …)ref. It's rendered as an always-presentaria-live="polite"region inapp/components/CommandPalette.client.vue(Lines 283-284), so it works independent of whether the command palette UI is open.It's already used for clipboard-copy feedback in a couple of places, e.g.:
app/components/Terminal/Install.vue(Lines 138, 152, 166, 180):announce($t('command_palette.announcements.copied_to_clipboard'))app/components/Package/Header.vue(Line 98): same patternYou could follow the same convention in
CopyMd.vue:This reuses the existing pattern rather than introducing a new toast/snackbar primitive, and keeps the fix scoped to this PR's copy-markdown flow.
✏️ Learnings added