Skip to content

feat: add anchor link copying to clipboard on click#883

Open
stenin-nikita wants to merge 5 commits intomasterfrom
nikita-stenin.DOCSTOOLS-3344.anchor-clipboard
Open

feat: add anchor link copying to clipboard on click#883
stenin-nikita wants to merge 5 commits intomasterfrom
nikita-stenin.DOCSTOOLS-3344.anchor-clipboard

Conversation

@stenin-nikita
Copy link

Description

  • Added clipboard copying for anchor links on click
  • Implemented unified tooltip system for reusability
  • Migrated inline code tooltips to new implementation
  • Removed old tooltip code while maintaining backward compatibility

@stenin-nikita stenin-nikita requested a review from a team as a code owner March 16, 2026 10:39
@stenin-nikita stenin-nikita requested review from martyanovandrey and removed request for a team March 16, 2026 10:39
@stenin-nikita stenin-nikita force-pushed the nikita-stenin.DOCSTOOLS-3344.anchor-clipboard branch from 6ee068d to a63e072 Compare March 16, 2026 10:41
@yc-ui-bot
Copy link
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
165 149 2 14 0 0 1m 41s

Failed Tests

Failed Tests ❌ Fail Message
❌ Click to inline code should open tooltip Test timeout of 30000ms exceeded.
❌ Click to inline code should open tooltip and close it after 1second Error: Timed out 5000ms waiting for expect(locator).toBeVisible()

Locator: locator('div[id="tooltip_inline_clipboard_dialog"]')
Expected: visible
Received:
Call log:
- expect.toBeVisible with timeout 5000ms
- waiting for locator('div[id="tooltip_inline_clipboard_dialog"]')

Github Test Reporter by CTRF 💚

@stenin-nikita stenin-nikita marked this pull request as draft March 16, 2026 10:44
@yc-ui-bot
Copy link
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
165 149 2 14 0 0 1m 41s

Failed Tests

Failed Tests ❌ Fail Message
❌ Click to inline code should open tooltip Test timeout of 30000ms exceeded.
❌ Click to inline code should open tooltip and close it after 1second Error: Timed out 5000ms waiting for expect(locator).toBeVisible()

Locator: locator('div[id="tooltip_inline_clipboard_dialog"]')
Expected: visible
Received:
Call log:
- expect.toBeVisible with timeout 5000ms
- waiting for locator('div[id="tooltip_inline_clipboard_dialog"]')

Github Test Reporter by CTRF 💚

@yc-ui-bot
Copy link
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
174 151 3 20 0 0 2m 14s

Failed Tests

Failed Tests ❌ Fail Message
❌ Click to anchor should open tooltip Test timeout of 30000ms exceeded.
❌ Click to anchor should open tooltip and close it after 1second Test timeout of 30000ms exceeded.
❌ Clipboard anchor click should return custom anchor url Test timeout of 30000ms exceeded.

Github Test Reporter by CTRF 💚

@stenin-nikita stenin-nikita force-pushed the nikita-stenin.DOCSTOOLS-3344.anchor-clipboard branch from 91930c5 to 1495ef1 Compare March 16, 2026 13:09
@yc-ui-bot
Copy link
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
174 154 0 20 0 0 1m 42s

🎉 No failed tests in this run.

Github Test Reporter by CTRF 💚

@stenin-nikita stenin-nikita force-pushed the nikita-stenin.DOCSTOOLS-3344.anchor-clipboard branch from 1495ef1 to 2756bc4 Compare March 16, 2026 13:21
@yc-ui-bot
Copy link
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
174 154 0 20 0 0 1m 45s

🎉 No failed tests in this run.

Github Test Reporter by CTRF 💚

@stenin-nikita stenin-nikita marked this pull request as ready for review March 16, 2026 13:24
const link = new URL(href, window.location.href).toString();
const link = getLink(target);

copyToClipboard(link).then(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

copyToClipboard can reject (e.g. page out of focus, no Clipboard API, iframe restrictions). What should happen in that case - silently ignore?

Copy link
Author

Choose a reason for hiding this comment

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

I'd say yes, silently ignore – we can't report it anyway. Not sure though, thoughts?

@@ -1,4 +1,4 @@
.inline_code_tooltip {
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you checked the use of this class in tests, viewer, and in general in the arcadia (tests etc may be tied to this). As an option, it is to keep the old class for compatibility and add a new one
.inline_code_tooltip,
.yfm-tooltip

Copy link
Author

Choose a reason for hiding this comment

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

I maintained backward compatibility in this code:

additionalClassName: 'inline_code_tooltip',

In this code section, there is no need to apply styles to the DOM element twice, so I removed the redundant CSS selector.

@stenin-nikita stenin-nikita force-pushed the nikita-stenin.DOCSTOOLS-3344.anchor-clipboard branch from 2756bc4 to c56f7bd Compare March 16, 2026 17:09
@stenin-nikita stenin-nikita force-pushed the nikita-stenin.DOCSTOOLS-3344.anchor-clipboard branch from c56f7bd to eb29d10 Compare March 16, 2026 17:12
@yc-ui-bot
Copy link
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
174 154 0 20 0 0 1m 39s

🎉 No failed tests in this run.

Github Test Reporter by CTRF 💚

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 16, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@yc-ui-bot
Copy link
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
174 154 0 20 0 0 1m 44s

🎉 No failed tests in this run.

Github Test Reporter by CTRF 💚

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.

4 participants