Skip to content

Conversation

@Michaelvll
Copy link
Collaborator

Tested (run the relevant ones):

  • Code formatting: install pre-commit (auto-check on commit) or bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: /smoke-test (CI) or pytest tests/test_smoke.py (local)
  • Relevant individual tests: /smoke-test -k test_name (CI) or pytest tests/test_smoke.py::test_name (local)
  • Backward compatibility: /quicktest-core (CI) or pytest tests/smoke_tests/test_backward_compat.py (local)

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Clipboard Copy Errors: Null Checks and Promise Handling

The copyDashboardCodeBlock function lacks robust error handling. It is missing null checks for DOM element queries (e.g., closest, querySelector), which can lead to TypeError crashes if the expected elements are not found. Additionally, the navigator.clipboard.writeText() call lacks a .catch() block, resulting in unhandled promise rejections if the clipboard operation fails.

sky/dashboard/src/hooks/useTour.js#L23-L36

if (typeof window !== 'undefined') {
window['copyDashboardCodeBlock'] = function (button) {
const codeContainer = button.closest('.bg-gray-50').querySelector('pre');
const codeBlock = codeContainer.querySelector('code.block');
const text = codeBlock.textContent;
navigator.clipboard.writeText(text).then(() => {
const originalSvg = button.innerHTML;
button.innerHTML =
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check h-5 w-5 text-green-600"><path d="m9 12 2 2 4-4"/></svg>';
setTimeout(() => {
button.innerHTML = originalSvg;
}, 2000);
});
};

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@Michaelvll Michaelvll enabled auto-merge (squash) July 21, 2025 06:25
@Michaelvll Michaelvll merged commit af46f17 into master Jul 21, 2025
34 of 43 checks passed
@Michaelvll Michaelvll deleted the tour-new branch July 21, 2025 06:33
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.

3 participants