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

feat: Add a 'dev mode' flag to the view, and a few developer utilities #212

Merged
merged 6 commits into from
Jul 19, 2022

Conversation

jonathonherbert
Copy link
Contributor

What does this change?

Adds a 'dev mode' parameter to the view function, which when true presents the user with two checkboxes that permit:

  • Turning real-time checking on and off
  • Adding annotations to ranges that have pending (orange) or in-flight (green) checks.

Pending checks are only really relevant in real time mode – they represent the ranges that have been 'dirtied' since the last check, and are due to be sent to Typerighter. In-flight checks have been sent to Typerighter and have not yet come back.

Here's how the UI looks:

Screenshot 2022-07-13 at 15 08 04

And here's the annotations at work, with an explanation:

pm-debug

I've defaulted dev mode to true in the sandbox – hopefully that makes sense.

How to test

Fire up prosemirror-typerighter locally and have a play. Does it behave as expected? Do you think these things will be useful?

…ed (#210)

* Allow enabling real-time checking when the plugin is instantiated

* Add test

* Reference IPluginConfig directly in IPluginOptions

Allow enabling real-time checking when the plugin is instantiated

Don't remove debug decorations when filtering decorations

Add test

Reference IPluginConfig directly in IPluginOptions
Allow enabling real-time checking when the plugin is instantiated

Reference IPluginConfig directly in IPluginOptions
Copy link
Contributor

@rebecca-thompson rebecca-thompson left a comment

Choose a reason for hiding this comment

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

Looks really good.

One thing I noticed was if you uncheck Show pending and inflight checks before the most recent inflight check has completed, the text highlighting remains. Is this intended or should highlighting be removed when the box is unchecked?

type="checkbox"
id="debug"
checked={debug}
onChange={() => setDebugState(!debug)}
Copy link
Contributor

Choose a reason for hiding this comment

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

debug is quite a generic term, could we rename this to something more specific? setShowPendingInflightChecks?

@jonathonherbert
Copy link
Contributor Author

@rebecca-thompson hm not removing those ranges is a bit lazy – thanks for noticing, let's remove them.

@jonathonherbert jonathonherbert merged commit 8a0519b into main Jul 19, 2022
@github-actions
Copy link

🎉 This PR is included in version 5.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants