Skip to content

fix: edit click on codeblock buttons#970

Merged
HelenVirtanen merged 2 commits into
masterfrom
fix-buttons-wrap-copy
Jul 7, 2026
Merged

fix: edit click on codeblock buttons#970
HelenVirtanen merged 2 commits into
masterfrom
fix-buttons-wrap-copy

Conversation

@HelenVirtanen

Copy link
Copy Markdown
Contributor

Fix code block floating button clicks after the markup update to the Gravity UI button structure.

@HelenVirtanen HelenVirtanen requested a review from reazy015 July 7, 2026 14:17
@HelenVirtanen HelenVirtanen requested review from a team and diplodoc-bot as code owners July 7, 2026 14:17
@yc-ui-bot

Copy link
Copy Markdown
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
189 163 6 20 0 0 2m 19s

Failed Tests

Failed Tests ❌ Fail Message
❌ code block visual regression after click copy button Error: expect(Buffer).toMatchSnapshot(expected) failed

4 pixels (ratio 0.01 of all image pixels) are different.

Snapshot: base-code-block-copied.png
❌ code block visual regression after toggle text wrapping Error: expect(Buffer).toMatchSnapshot(expected) failed

Expected an image 568px by 72px, received 568px by 92px. 1457 pixels (ratio 0.03 of all image pixels) are different.

Snapshot: long-content-code-block-text-wrapping.png
❌ code block visual regression after click copy button Error: expect(Buffer).toMatchSnapshot(expected) failed

4 pixels (ratio 0.01 of all image pixels) are different.

Snapshot: base-code-block-copied.png
❌ code block visual regression after toggle text wrapping Error: expect(Buffer).toMatchSnapshot(expected) failed

Expected an image 568px by 72px, received 568px by 92px. 946 pixels (ratio 0.02 of all image pixels) are different.

Snapshot: long-content-code-block-text-wrapping.png
❌ code block visual regression after click copy button Error: expect(Buffer).toMatchSnapshot(expected) failed

11 pixels (ratio 0.01 of all image pixels) are different.

Snapshot: base-code-block-copied.png
❌ code block visual regression after toggle text wrapping Error: expect(Buffer).toMatchSnapshot(expected) failed

Expected an image 1136px by 144px, received 1136px by 184px. 3899 pixels (ratio 0.02 of all image pixels) are different.

Snapshot: long-content-code-block-text-wrapping.png

Github Test Reporter by CTRF 💚

@HelenVirtanen HelenVirtanen force-pushed the fix-buttons-wrap-copy branch from 08f8d7d to b940933 Compare July 7, 2026 14:51
@yc-ui-bot

Copy link
Copy Markdown
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
189 169 0 20 0 1 1m 58s

🎉 No failed tests in this run.

Github Test Reporter by CTRF 💚

@HelenVirtanen HelenVirtanen force-pushed the fix-buttons-wrap-copy branch from b940933 to d26c5a0 Compare July 7, 2026 14:57
@yc-ui-bot

Copy link
Copy Markdown
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
189 163 6 20 0 0 2m 23s

Failed Tests

Failed Tests ❌ Fail Message
❌ code block visual regression after click copy button Error: expect(Buffer).toMatchSnapshot(expected) failed

4 pixels (ratio 0.01 of all image pixels) are different.

Snapshot: base-code-block-copied.png
❌ code block visual regression after toggle text wrapping Error: expect(Buffer).toMatchSnapshot(expected) failed

Expected an image 568px by 72px, received 568px by 92px. 1457 pixels (ratio 0.03 of all image pixels) are different.

Snapshot: long-content-code-block-text-wrapping.png
❌ code block visual regression after click copy button Error: expect(Buffer).toMatchSnapshot(expected) failed

4 pixels (ratio 0.01 of all image pixels) are different.

Snapshot: base-code-block-copied.png
❌ code block visual regression after toggle text wrapping Error: expect(Buffer).toMatchSnapshot(expected) failed

Expected an image 568px by 72px, received 568px by 92px. 946 pixels (ratio 0.02 of all image pixels) are different.

Snapshot: long-content-code-block-text-wrapping.png
❌ code block visual regression after click copy button Error: expect(Buffer).toMatchSnapshot(expected) failed

11 pixels (ratio 0.01 of all image pixels) are different.

Snapshot: base-code-block-copied.png
❌ code block visual regression after toggle text wrapping Error: expect(Buffer).toMatchSnapshot(expected) failed

Expected an image 1136px by 144px, received 1136px by 184px. 3899 pixels (ratio 0.02 of all image pixels) are different.

Snapshot: long-content-code-block-text-wrapping.png

Github Test Reporter by CTRF 💚

@yc-ui-bot

Copy link
Copy Markdown
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
189 169 0 20 0 0 1m 58s

🎉 No failed tests in this run.

Github Test Reporter by CTRF 💚

Comment thread src/js/code.ts Outdated
function buttonWrapFn(target: HTMLElement) {
const container = target.parentNode?.parentNode;
const button = target.closest<HTMLElement>(WRAP_BUTTON_SELECTOR);
const container = button?.closest<HTMLElement>('.yfm-code-floating-container');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

.yfm-code-floating-container - it could be a const variable like WRAP_BUTTON_SELECTOR

@HelenVirtanen HelenVirtanen force-pushed the fix-buttons-wrap-copy branch from 98c3cef to f22ff36 Compare July 7, 2026 16:27
@yc-ui-bot

Copy link
Copy Markdown
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
189 163 6 20 0 0 2m 19s

Failed Tests

Failed Tests ❌ Fail Message
❌ code block visual regression after click copy button Error: expect(Buffer).toMatchSnapshot(expected) failed

4 pixels (ratio 0.01 of all image pixels) are different.

Snapshot: base-code-block-copied.png
❌ code block visual regression after toggle text wrapping Error: expect(Buffer).toMatchSnapshot(expected) failed

Expected an image 568px by 72px, received 568px by 92px. 1457 pixels (ratio 0.03 of all image pixels) are different.

Snapshot: long-content-code-block-text-wrapping.png
❌ code block visual regression after click copy button Error: expect(Buffer).toMatchSnapshot(expected) failed

4 pixels (ratio 0.01 of all image pixels) are different.

Snapshot: base-code-block-copied.png
❌ code block visual regression after toggle text wrapping Error: expect(Buffer).toMatchSnapshot(expected) failed

Expected an image 568px by 72px, received 568px by 92px. 946 pixels (ratio 0.02 of all image pixels) are different.

Snapshot: long-content-code-block-text-wrapping.png
❌ code block visual regression after click copy button Error: expect(Buffer).toMatchSnapshot(expected) failed

11 pixels (ratio 0.01 of all image pixels) are different.

Snapshot: base-code-block-copied.png
❌ code block visual regression after toggle text wrapping Error: expect(Buffer).toMatchSnapshot(expected) failed

Expected an image 1136px by 144px, received 1136px by 184px. 3899 pixels (ratio 0.02 of all image pixels) are different.

Snapshot: long-content-code-block-text-wrapping.png

Github Test Reporter by CTRF 💚

@HelenVirtanen HelenVirtanen force-pushed the fix-buttons-wrap-copy branch from f22ff36 to 5bf58d8 Compare July 7, 2026 17:53
@yc-ui-bot

Copy link
Copy Markdown
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
189 163 6 20 0 0 2m 28s

Failed Tests

Failed Tests ❌ Fail Message
❌ code block visual regression after click copy button Error: expect(Buffer).toMatchSnapshot(expected) failed

4 pixels (ratio 0.01 of all image pixels) are different.

Snapshot: base-code-block-copied.png
❌ code block visual regression after toggle text wrapping Error: expect(Buffer).toMatchSnapshot(expected) failed

Expected an image 568px by 72px, received 568px by 92px. 1457 pixels (ratio 0.03 of all image pixels) are different.

Snapshot: long-content-code-block-text-wrapping.png
❌ code block visual regression after click copy button Error: expect(Buffer).toMatchSnapshot(expected) failed

4 pixels (ratio 0.01 of all image pixels) are different.

Snapshot: base-code-block-copied.png
❌ code block visual regression after toggle text wrapping Error: expect(Buffer).toMatchSnapshot(expected) failed

Expected an image 568px by 72px, received 568px by 92px. 946 pixels (ratio 0.02 of all image pixels) are different.

Snapshot: long-content-code-block-text-wrapping.png
❌ code block visual regression after click copy button Error: expect(Buffer).toMatchSnapshot(expected) failed

11 pixels (ratio 0.01 of all image pixels) are different.

Snapshot: base-code-block-copied.png
❌ code block visual regression after toggle text wrapping Error: expect(Buffer).toMatchSnapshot(expected) failed

Expected an image 1136px by 144px, received 1136px by 184px. 3899 pixels (ratio 0.02 of all image pixels) are different.

Snapshot: long-content-code-block-text-wrapping.png

Github Test Reporter by CTRF 💚

@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

@yc-ui-bot

Copy link
Copy Markdown
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
189 169 0 20 0 0 2m 4s

🎉 No failed tests in this run.

Github Test Reporter by CTRF 💚

@HelenVirtanen HelenVirtanen merged commit ff4c0f3 into master Jul 7, 2026
10 checks passed
@HelenVirtanen HelenVirtanen deleted the fix-buttons-wrap-copy branch July 7, 2026 18:16
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