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(highlight): Change cursor in Highlight Text mode #544

Merged
merged 3 commits into from
Jul 28, 2020

Conversation

mxiao6
Copy link
Contributor

@mxiao6 mxiao6 commented Jul 27, 2020

  • Tests

@mxiao6 mxiao6 requested a review from a team as a code owner July 27, 2020 23:34
@mxiao6 mxiao6 marked this pull request as draft July 27, 2020 23:34
@mxiao6 mxiao6 force-pushed the add-highlight-cursor branch from 4760fbb to ab9ec85 Compare July 28, 2020 00:37
@mxiao6 mxiao6 marked this pull request as ready for review July 28, 2020 00:37
@mxiao6 mxiao6 force-pushed the add-highlight-cursor branch from ab9ec85 to f10c5be Compare July 28, 2020 00:38
src/highlight/HighlightAnnotations.tsx Outdated Show resolved Hide resolved
src/document/DocumentAnnotator.ts Show resolved Hide resolved
src/highlight/HighlightAnnotations.scss Show resolved Hide resolved

// Construct a layer element where we can inject a root React component
const rootLayerEl = documentEl.createElement('div');
rootLayerEl.classList.add('ba-Layer');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have any concerns about rendering this layer even though the feature is not yet available?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the toolbar highlight button is not clicked, we actually only render a <div /> with absolute positioning and pointer-event: none. So I don't have any concerns.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Gotcha. I think @ConradJChan had some concerns about rendering these components unconditionally, but I don't recall why. It should be okay for now, but we'll need to keep this in mind if we add anything else outside of the "creator" components.

jest.mock('../../common/withProviders');
jest.mock('../HighlightAnnotations');

describe('HighlightContainer', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we follow the path format here? I'd also be game for nuking the path entirely and just using the component name. Maintaining the path here seems tedious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will nuke the path entirely in the followup pr.

Copy link
Collaborator

@jstoffan jstoffan left a comment

Choose a reason for hiding this comment

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

LGTM, just make super sure there are no regressions for region annotations.

@mergify mergify bot merged commit 9535ee4 into box:master Jul 28, 2020
@mxiao6 mxiao6 deleted the add-highlight-cursor branch August 13, 2020 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants