Skip to content

Commit

Permalink
Small polish to the overlay (#9214)
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh authored Nov 29, 2023
1 parent c0383ea commit 4fe523b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-dragons-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes a number of small user experience bugs with the dev overlay
14 changes: 9 additions & 5 deletions packages/astro/src/runtime/client/dev-overlay/plugins/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>`
)
Expand All @@ -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);
Expand All @@ -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() {
Expand Down

0 comments on commit 4fe523b

Please sign in to comment.