diff options
author | 2023-11-29 13:52:11 +0100 | |
---|---|---|
committer | 2023-11-29 13:52:11 +0100 | |
commit | 4fe523b0064b323ee46b2574339d96ea8bdb7b2d (patch) | |
tree | b5118fa08f2d419d08754ce6e2d0684249fd122b | |
parent | c0383ea0c102cb62b7235823c706a090ba08715f (diff) | |
download | astro-4fe523b0064b323ee46b2574339d96ea8bdb7b2d.tar.gz astro-4fe523b0064b323ee46b2574339d96ea8bdb7b2d.tar.zst astro-4fe523b0064b323ee46b2574339d96ea8bdb7b2d.zip |
Small polish to the overlay (#9214)
-rw-r--r-- | .changeset/tricky-dragons-explain.md | 5 | ||||
-rw-r--r-- | packages/astro/src/runtime/client/dev-overlay/plugins/astro.ts | 14 |
2 files changed, 14 insertions, 5 deletions
diff --git a/.changeset/tricky-dragons-explain.md b/.changeset/tricky-dragons-explain.md new file mode 100644 index 000000000..78ecb1e95 --- /dev/null +++ b/.changeset/tricky-dragons-explain.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes a number of small user experience bugs with the dev overlay diff --git a/packages/astro/src/runtime/client/dev-overlay/plugins/astro.ts b/packages/astro/src/runtime/client/dev-overlay/plugins/astro.ts index 951101bae..53fbc6502 100644 --- a/packages/astro/src/runtime/client/dev-overlay/plugins/astro.ts +++ b/packages/astro/src/runtime/client/dev-overlay/plugins/astro.ts @@ -324,13 +324,13 @@ export default { (window as DevOverlayMetadata).__astro_dev_overlay__.version }</astro-dev-overlay-badge> </section> - <astro-dev-overlay-button id="copy-debug-button">Get debug info <astro-dev-overlay-icon icon="copy" /></astro-dev-overlay-button> + <astro-dev-overlay-button id="copy-debug-button">Copy debug info <astro-dev-overlay-icon icon="copy" /></astro-dev-overlay-button> </header> <hr /> <div id="main-container"> <div> - <header><h2>Top integrations</h2><a href="https://astro.build/integrations/">View all</a></header> + <header><h2>Top integrations</h2><a href="https://astro.build/integrations/" target="_blank">View all</a></header> <div id="integration-list-wrapper"> <section id="integration-list"> <div class="integration-skeleton" style="--i:0;"></div> @@ -345,7 +345,7 @@ export default { ${links .map( (link) => - `<a href="${link.link}"><astro-dev-overlay-icon ${ + `<a href="${link.link}" target="_blank"><astro-dev-overlay-icon ${ isDefinedIcon(link.icon) ? `icon="${link.icon}">` : `>${link.icon}` }</astro-dev-overlay-icon>${link.name}</a>` ) @@ -362,7 +362,11 @@ export default { navigator.clipboard.writeText( '```\n' + (window as DevOverlayMetadata).__astro_dev_overlay__.debugInfo + '\n```' ); - copyDebugButton.textContent = 'Copied to clipboard'; + copyDebugButton.textContent = 'Copied to clipboard!'; + + setTimeout(() => { + resetDebugButton(); + }, 3500); }); canvas.append(windowComponent); @@ -372,7 +376,7 @@ export default { const copyDebugButton = canvas.querySelector<HTMLButtonElement>('#copy-debug-button'); if (!copyDebugButton) return; - copyDebugButton.innerHTML = 'Get debug info <astro-dev-overlay-icon icon="copy" />'; + copyDebugButton.innerHTML = 'Copy debug info <astro-dev-overlay-icon icon="copy" />'; } function refreshIntegrationList() { |