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

Small polish to the overlay #9214

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/tricky-dragons-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'astro': patch
---

Small polish to the dev overlay:
- Links inside the Astro panel now open in a new tab
- The "Copy debug info" button will now reset back to its original state after 3.5 seconds without needing to toggle off the plugin
Princesseuh marked this conversation as resolved.
Show resolved Hide resolved
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
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export default {
const noAuditIcon = getIconElement('check-circle');
const text = document.createElement('div');
text.textContent = 'No issues found!';
text.role = 'alert';

if (noAuditIcon) {
noAuditIcon.style.width = '24px';
Expand Down
Loading