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

Two improvements to cocoa MultilineTextInput: disable richtext, and enable undo #2037

Conversation

bruno-rino
Copy link
Contributor

I found the current cocoa implementation MultilineTextInput lacking:

  • When pasting formatted text (e.g. a webpage), the formatting would stay. Since this widget doesn't allow to manipulate the formatting in any way, I think it best to disable it completely.
  • The cocoa widget has undo/redo turned of by default

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@freakboy3742
Copy link
Member

Thanks for the contribution. I'm currently travelling for EuroPython, so finding time for PR reviews is a bit difficult; however, from an initial inspection, this looks good. The only thing obvious improvement I can think of would be a test - this change doesn't decrease code coverage, but it would be good to have some form of validation that pasting rich content or executing an undo has the desired behavior. The complication is that the test will need backend probe implementations for all platforms - however, I think we could probably live with a skip implementation that explicitly flags that the test hasn't been fully implemented on Windows/GTK etc yet.

@bruno-rino
Copy link
Contributor Author

How would such tests fit in? Beyond the dummy backend testing, there's a whole architecture I do not grasp (cocoa/tests_backend, testbed, and what are probes?). I would need some guidance here.

@freakboy3742
Copy link
Member

@bruno-rino As luck would have it, I've just written up an explanation of the testbed architecture for another PR. A cleaned up version of this should probably be in our contribution guide; I've opened #2137 to track this.

@mhsmith
Copy link
Member

mhsmith commented Sep 27, 2023

@bruno-rino
Copy link
Contributor Author

I am writing an undo / redo test for macOS. Which approach would be preferable for triggering the undo / redo action:

  • emit "cmd+Z" and "cmd+shift+Z"
  • use cocoa API (NSUndoManager)

@freakboy3742
Copy link
Member

I am writing an undo / redo test for macOS. Which approach would be preferable for triggering the undo / redo action:

Cmd-(shift)-Z seems like the better option to me - we're looking to confirm the action as close to "human" interaction as possible.

@bruno-rino
Copy link
Contributor Author

So... I guess I should have updated my branch beforehand.

@bruno-rino
Copy link
Contributor Author

Replaced with PR #2151

@bruno-rino bruno-rino closed this Oct 10, 2023
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