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

Have CopyDebugInfoButton change text to Copied... on click #9119

Merged

Conversation

jonathan-eq
Copy link
Contributor

@jonathan-eq jonathan-eq commented Oct 31, 2024

This commit refactors the copydebuginfobutton in run_dialog.py into its own class, and makes it change text Copy Debug Info -> Copied... when clicked while running the callback passed to it. After one second, it changes it text back to Copy Debug Info.

Approach
🚠

(Screenshot of new behavior in GUI if applicable)

Screen.Recording.2024-10-31.at.15.06.59.mov
  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'pytest tests/ert/unit_tests -n logical -m "not integration_test"')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Create Backport PR to latest release

@jonathan-eq jonathan-eq added the release-notes:improvement Automatically categorise as improvement in release notes label Oct 31, 2024
@jonathan-eq jonathan-eq self-assigned this Oct 31, 2024
@jonathan-eq jonathan-eq force-pushed the improve-copy-debug-info-button branch from f48a33c to 2908de4 Compare October 31, 2024 14:22
@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.75%. Comparing base (d294930) to head (2f2e5d3).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9119      +/-   ##
==========================================
- Coverage   90.75%   90.75%   -0.01%     
==========================================
  Files         350      350              
  Lines       21778    21799      +21     
==========================================
+ Hits        19764    19783      +19     
- Misses       2014     2016       +2     
Flag Coverage Δ
cli-tests 39.02% <0.00%> (-0.01%) ⬇️
gui-tests 71.72% <76.47%> (+0.03%) ⬆️
performance-tests 49.25% <76.47%> (+0.04%) ⬆️
unit-tests 79.61% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

self.setFixedWidth(140)

def alternate_button_text_on_click_and_call_callback() -> None:
self.setText("Copied...")
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider alternatives like;
Copied!
Copied to clipboard!
Copied to clipboard

Copy link
Contributor Author

@jonathan-eq jonathan-eq Nov 1, 2024

Choose a reason for hiding this comment

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

I tried the alternatives, but I think Copied.. looks better

Copy link
Contributor

@andreas-el andreas-el left a comment

Choose a reason for hiding this comment

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

Absolutely brilliant! Had some small suggestions, but you can decided what to act on, if anything. ❤️

@jonathan-eq jonathan-eq force-pushed the improve-copy-debug-info-button branch from 2908de4 to 26959fd Compare November 1, 2024 06:03
This commit refactors the copydebuginfobutton in run_dialog.py into its own class, and makes it change text `Copy Debug Info" -> `Copied...` when clicked while running the callback passed to it. After one second, it changes it text back to `Copy Debug Info`.
@jonathan-eq jonathan-eq force-pushed the improve-copy-debug-info-button branch from 26959fd to 2f2e5d3 Compare November 1, 2024 06:59
@jonathan-eq jonathan-eq enabled auto-merge (rebase) November 1, 2024 07:05
@jonathan-eq jonathan-eq merged commit 3b1db99 into equinor:main Nov 1, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:improvement Automatically categorise as improvement in release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants