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

Copying highlighted text with automataic color respects automatic color, but perhaps this shouldn't be the case #13

Open
HeroicMeaning opened this issue Sep 19, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request usability
Milestone

Comments

@HeroicMeaning
Copy link

HeroicMeaning commented Sep 19, 2021

Bug Description

Cutting and pasting highlighted text gives unpleasant results in dark mode

Steps to Reproduce

  1. create text in MS word on osx dark mode- highlight some of it with yellow (or blue, green)
  2. past in qprompt in dark mode

Expected behavior

the highlights look similar

Actual Behavior

the highlight is the normal highlight color - however, because qprompt is in dark mode, the text is white, rather than black, so the highlight washes the text out. see pic

I don't know if this an ms word thing, or more general.

Detailed description of display configuration (if applicable)

...

Screenshots (if applicable)

https://www.dropbox.com/s/d6kx0ch437r6gis/Screen%20Shot%202021-09-19%20at%203.15.53%20PM.png?dl=0
Screen Shot 2021-09-19 at 3 15 53 PM

Device information

  • osx 10.14.6
  • ms word 16.52 (subscription updated)
  • QPrompt Version: [e.g. 1.0.0-beta-003]

Additional context

...

@Cuperino Cuperino added the bug Something isn't working label Sep 19, 2021
@Cuperino
Copy link
Owner

This one's going to be a little complicated to debug. The issue has to do with the formatting contained in the copied text and how QPrompt interprets that formatting. To debug this, I've created a tool that allows me to visualize the formatting metadata in copied text. Then I look for markers in that data to use in filtering rules that take care of issues like this one, while preserving most of the formatting.

I haven't yet setup a pipeline for building this tool on macOS, but I'll do that and then we'll be able to read what formatting is in the text being copied and fix the issue.

@Cuperino Cuperino added this to the 1.0 milestone Sep 19, 2021
@Cuperino Cuperino changed the title Cutting and pasting highlighted text gives unpleasant results in dark mode Copying highlighted text from current MS Word for macOS in dark mode results in default white text color not being disregarded Sep 20, 2021
@Cuperino Cuperino modified the milestones: 1.0, 1.x Dec 31, 2021
@Cuperino Cuperino modified the milestones: 1.x, 1.1.1 Aug 11, 2022
@Cuperino Cuperino modified the milestones: 1.1.1, 1.2 Aug 18, 2022
@Cuperino
Copy link
Owner

Cuperino commented Jan 8, 2023

@HeroicMeaning Sorry that it took me this long to test this. I couldn't get my clipboard inspection app to work reliably on macOS. It's working good enough now to make these tests myself, so I just got a trial for Office 365 for Mac.

After replicating your issue, I can say for sure that the text color follows QPrompt's intended behavior. The highlight is also behaving as intended. The color representations being copied from Word correspond to the colors to be used when printing the document, and not the colors that are visible on screen.

I realize that by QPrompt not replacing the highlight colors with lower contrast versions, these can result in text that's inconvenient to read. I'll look into ways to modify or represent the imported highlights to improve readability.

@Cuperino Cuperino added enhancement New feature or request and removed bug Something isn't working labels Jan 8, 2023
@Cuperino Cuperino modified the milestones: 1.2, 1.1.3 Jan 8, 2023
@Cuperino Cuperino moved this to Queue in QPrompt Feb 25, 2023
@Cuperino Cuperino added this to QPrompt Feb 25, 2023
@Cuperino Cuperino modified the milestones: 1.2, 1.3 Oct 2, 2023
@Cuperino Cuperino changed the title Copying highlighted text from current MS Word for macOS in dark mode results in default white text color not being disregarded Copying highlighted text with automataic color respects automatic color, but perhaps this shouldn't be the case Oct 17, 2023
@Cuperino Cuperino modified the milestones: 1.3, 1.2 Oct 17, 2023
@Cuperino Cuperino modified the milestones: 1.2, 1.3 Sep 29, 2024
@Cuperino
Copy link
Owner

Cuperino commented Oct 24, 2024

Quoting key notes from #290:

"Automatically changing the default text color after a highlight color has been set" is a quality of life feature implemented by Microsoft Office and other office suites no more than a decade ago. When highlighted text is copied, QPrompt only receives the metadata from the highlight, there's no data on text color coming-in because that is technically still the default. For the color to match, QPrompt would have to match the logic from those programs, which would in turn make it not match the logic of other programs, such as web browsers.

That however shouldn't be an issue, for we can look at import metadata to tell when the text comes from a document and treat that text differently. Nevertheless, the more complex the logic is, the harder it can be to maintain. For that reason I'd like to keep this logic as simple as possible.

The best we can do is try to replicate the behavior from Microsoft Office and LibreOffice. That is, we should treat the text-color metadata as non-existent and store only highlight information, but treat that highlight information as something that affects both color and highlight. I'm honestly not sure of how to program this, but that is how the logic should go to match the office suites and what would produce the behavior users expect."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request usability
Projects
Status: Queue
Development

No branches or pull requests

2 participants