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

Ability to paste rich text into the editor (and have it auto-convert to an element if no element is selected) #760

Closed
jauyong opened this issue Mar 25, 2020 · 19 comments · Fixed by #5112
Assignees
Labels
Accessibility Changes that impact accessibility and need corresponding review (e.g. markup changes). Elements: Text Group: Workspace A group encompassing all of workspace – everything inside the canvas and sidebar P2 Should do soon Type: Enhancement New feature or improvement of an existing feature

Comments

@jauyong
Copy link

jauyong commented Mar 25, 2020

Feature Description

As an editor I want to be able to paste rich text into the editor.

Feature Brief


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance Criteria

  1. When not focused on an input, a new element should be created (with stripped away styling except for bold, etc.) (partly DONE in Basic text paste #1105, needs moving to global level)
  2. We should strip away styling with the exception of bold, italic, underline and strikethrough (DONE in Basic text paste #1105)
  3. When focused on text inputs, fallback to browser native cut/copy/paste
  4. NOTE: strikethrough can come later, as it's not in the editor UI yet
  5. See comments for required investigation for character sets

As of Apr 21:
paste styling

QA Instructions

Please see notes in PR #5112.

@jauyong
Copy link
Author

jauyong commented Mar 25, 2020

@pbakaus

  1. Should paste also include any rich styling (bold, hyperlink, etc...)?
  2. What about character sets and special characters? (UTF8MB4)

@pbakaus
Copy link
Contributor

pbakaus commented Mar 26, 2020

@jauyong great questions:

  1. We should strip away styling with the exception of bold, italic, underline and strikethrough ( strikethrough can come later, as it's not in the editor UI yet).

  2. Actually not sure – when I copy text from a, say, ASCII encoding and paste it in the browser, does the browser not automatically convert/normalize to UTF-8? Might need some exploration.

@jauyong jauyong assigned spacedmonkey and unassigned pbakaus Mar 27, 2020
@spacedmonkey spacedmonkey removed their assignment Mar 30, 2020
@miina miina self-assigned this Apr 1, 2020
@miina miina added Type: Bug Something isn't working Type: Enhancement New feature or improvement of an existing feature labels Apr 1, 2020
@jauyong jauyong added the P0 Critical, drop everything label Apr 5, 2020
@miina
Copy link
Contributor

miina commented Apr 6, 2020

@jauyong To confirm -- based on the description, the issue seems to be about handling inputs only, if I understand correctly then it's actually the opposite:
When not focused on an input, a new element should be created (with stripped away styling except for bold, etc.), that being the main goal/change of the issue. And when focused on inputs, the native browsers copy/paste should continue working as-is.

Let me know if I misunderstood.

@jauyong
Copy link
Author

jauyong commented Apr 6, 2020

Hey @miina yea what you said is correct. I added your note as AC1.

@miina miina mentioned this issue Apr 8, 2020
@pbakaus pbakaus changed the title Global Text Paste Ability to paste rich text into the editor (and have it auto-convert to an element if no element is selected) Apr 11, 2020
@pbakaus pbakaus removed the Type: Bug Something isn't working label Apr 11, 2020
@pbakaus pbakaus added this to the 1.0 Beta milestone Apr 11, 2020
@pbakaus
Copy link
Contributor

pbakaus commented Apr 11, 2020

@samitron7 I think this might warrant some Figma love for the final feature..your flow should describe what happens when I paste rich text from Google Docs, or a block of HTML with an image in it etc.

@miina
Copy link
Contributor

miina commented Apr 16, 2020

Moving this back to todo since the basic pasting got partly implemented via #1105, however, there are still parts that need implementation, such as:

@miina miina removed their assignment Apr 16, 2020
@kmyram kmyram removed this from the 1.0 Beta milestone Apr 16, 2020
@jauyong
Copy link
Author

jauyong commented Apr 22, 2020

We are pushing this from sprint 27 / 1.0 Beta while we wait for the other text fixes that Morten is working on

@swissspidy swissspidy added Accessibility Changes that impact accessibility and need corresponding review (e.g. markup changes). Elements: Text labels Apr 23, 2020
@o-fernandez o-fernandez added P1 High priority, must do soon P2 Should do soon and removed P0 Critical, drop everything P1 High priority, must do soon labels May 6, 2020
@o-fernandez o-fernandez added P2 Should do soon and removed P1 High priority, must do soon labels Sep 22, 2020
@barklund barklund self-assigned this Nov 1, 2020
@barklund barklund added Group: Workspace A group encompassing all of workspace – everything inside the canvas and sidebar Pod: Prometheus labels Nov 2, 2020
@bmattb bmattb added this to the Sprint 41 milestone Nov 3, 2020
@bmattb bmattb removed the Pod: Pea label Nov 3, 2020
@bmattb bmattb modified the milestones: Sprint 41, Sprint 42 Nov 16, 2020
@csossi
Copy link

csossi commented Nov 22, 2020

Verified in QA

Works as described in PR#5112 with some formatting NOT pasted

@csossi csossi removed their assignment Nov 22, 2020
@barklund barklund reopened this Nov 23, 2020
@samitron7
Copy link

samitron7 commented Nov 26, 2020

Is there a reason why the rich text is pasted in centered aligned and not left justified for the pure canvas case? All our text presets are left aligned. @barklund FYI

@bmattb bmattb modified the milestones: Sprint 42, Sprint 43 Dec 2, 2020
@o-fernandez
Copy link
Contributor

@barklund looks good, but @samitron7 has a question that would be worth addressing. I also noticed that it's all center aligned on paste, unless I first add a text element and then paste while in edit mode.

Original in docs
image.png

Pasted in canvas - first by just cmd+V on canvas, second by adding a paragraph text element and cmd+v while in text edit mode.
image.png

@bmattb bmattb modified the milestones: Sprint 43, Super Sprint 44 Dec 14, 2020
@o-fernandez
Copy link
Contributor

Checked in UAT, still pastes as center aligned even if original content is not. Is this expected? @barklund @samitron7

@swissspidy
Copy link
Collaborator

Sounds unexpected to me. Would need a new ticket to resolve.

@o-fernandez
Copy link
Contributor

@bmattb @barklund mind following up and ensuring there's a ticket/something to address this?

@barklund
Copy link
Contributor

barklund commented Jan 15, 2021

@o-fernandez , @samitron7: The default text set added by pressing the quick "+" next to the T in the library tab adds a new text field with center alignment. This same preset is used for pasted text so the alignment (and font size, family, etc) is taken from there.

@ivayloklissarov
Copy link

Tested and rich text works fine now. Closing the ticket. @tmagalhaes-huge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility Changes that impact accessibility and need corresponding review (e.g. markup changes). Elements: Text Group: Workspace A group encompassing all of workspace – everything inside the canvas and sidebar P2 Should do soon Type: Enhancement New feature or improvement of an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.