8000 add exception copy to clipboard by MarcSkovMadsen · Pull Request #8034 · holoviz/panel · GitHub < 8000 meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
[go: up one dir, main page]

Skip to content

Conversation

@MarcSkovMadsen
Copy link
Collaborator
@MarcSkovMadsen MarcSkovMadsen commented Jul 9, 2025

Closing #8019

Visual test

image

image

import panel as pn

pn.extension(theme="default")

raise Exception("This is an intentional exception to demonstrate error handling in Panel.")

pn.panel("This will not be rendered in the browser.").servable()

@MarcSkovMadsen MarcSkovMadsen requested a review from Copilot July 9, 2025 05:02
Copy link
Contributor
Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the autoreload exception handler by adding a copy-to-clipboard button to error alerts, and includes a unit test for the new button.

  • Introduces _create_copy_button to generate a ButtonIcon with clipboard functionality
  • Updates autoreload_handle_exception to wrap alerts and the copy button in a relative container
  • Adds test_create_copy_button to validate the new widget’s basic properties

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
panel/io/handlers.py Implements _create_copy_button, integrates it into exception UI with styling and JS callback
panel/tests/io/test_handlers.py Imports private helper and adds test_create_copy_button to assert icon and positioning
Comments suppressed due to low confidence (2)

panel/tests/io/test_handlers.py:212

  • [nitpick] The test only verifies the 'position' style. Consider adding assertions for other critical properties (top, right, z-index, background-color, etc.) and checking that the js_on_click callback is attached correctly to improve coverage.
    assert styles['position'] == 'absolute'

panel/io/handlers.py:285

  • The CSS variable includes an extra colon inside var(). It should be var(--panel-surface-color) (without the trailing colon) to apply correctly.
            'background-color': 'var(--panel-surface-color:)',

@MarcSkovMadsen
Copy link
Collaborator Author

I've removed the : mentioned by copilot.

@MarcSkovMadsen MarcSkovMadsen linked an issue Jul 9, 2025 that may be closed by this pull request
@MarcSkovMadsen MarcSkovMadsen marked this pull request as ready for review July 9, 2025 05:07
@MarcSkovMadsen MarcSkovMadsen requested a review from philippjfr July 9, 2025 05:07
@codecov
Copy link
codecov bot commented Jul 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.08%. Comparing base (fd3c7ba) to head (7b5af6f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8034      +/-   ##
==========================================
+ Coverage   86.03%   87.08%   +1.04%     
==========================================
  Files         346      346              
  Lines       53475    53493      +18     
==========================================
+ Hits        46008    46584     +576     
+ Misses       7467     6909     -558     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@philippjfr philippjfr merged commit 4a5a058 into main Jul 9, 2025
19 checks passed
@philippjfr philippjfr deleted the enhancement/dev-exception-clipboard branch July 9, 2025 08:22
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add copy to clipboard button to client exceptions

3 participants

0