Closed Bug 1843054 Opened 2 years ago Closed 2 years ago

Enable adding image PDF editing feature in Release

Categories

(Firefox :: PDF Viewer, enhancement)

enhancement

Tracking

()

VERIFIED FIXED
120 Branch
Tracking Status
relnote-firefox --- 119+
firefox119 + verified
firefox120 --- verified

People

(Reporter: marco, Assigned: calixte)

References

Details

Attachments

(3 files)

Once we are ready, we should set pdfjs.enableStampEditor to true for Release.

Release Note Request (optional, but appreciated)
[Why is this notable]: New PDF editing feature often requested by users.
[Affects Firefox for Android]: No.
[Suggested wording]: Firefox now supports editing PDFs by adding images, in addition to adding text and drawing.
[Links (documentation, blog post, etc)]: N/A.

relnote-firefox: --- → ?
Depends on: 1843246
Depends on: 1843255
Depends on: 1843299
Depends on: 1843303
Depends on: 1844036
No longer depends on: 1843246
See Also: → 1843246
No longer depends on: 1843299

I've verbally shared this (with Usama) in a couple meetings, but want to make sure these a11y requirements are officially logged. (Please let me know if this needs to be documented elsewhere, too!)

  1. When an image is added to a PDF by users, they need to be able to also add alt-text for that image.
  2. When a user edits an image they've added to a PDF, they need to be able to edit the alt-text for that image as well.

(In reply to kbryant from comment #2)

I've verbally shared this (with Usama) in a couple meetings, but want to make sure these a11y requirements are officially logged. (Please let me know if this needs to be documented elsewhere, too!)

  1. When an image is added to a PDF by users, they need to be able to also add alt-text for that image.
  2. When a user edits an image they've added to a PDF, they need to be able to edit the alt-text for that image as well.

Do you think this should be a blocker for releasing the feature?

We can't take inspiration from the state of the art for this because no other PDF editor supports it AFAIK, so we will need UX and accessibility team support to build the alt-text additional functionality.

Flags: needinfo?(kbryant)

:morgan, could you test this new feature (i.e. adding an image in pdf) in nightly and give us your feedback from an a11y point of view ?

Flags: needinfo?(mreschenberg)

I'm talking with Kim about the alt text feature on Tue.

Flags: needinfo?(kbryant)

(In reply to Calixte Denizet (:calixte) from comment #4)

:morgan, could you test this new feature (i.e. adding an image in pdf) in nightly and give us your feedback from an a11y point of view ?

are there instructions for how to do this somewhere? I'm not familiar

Flags: needinfo?(mreschenberg)

This is an addition on top of drawing and adding text, the earlier accessibility review happened in bug 1777257.

You can add an image by clicking on the relevant icon in the PDF viewer toolbar (the icon between download and add text, on the top right corner).

Depends on: 1845087
No longer depends on: 1845087

Added to the Nightly relnotes. Once the patch lands for this to ride the trains, we can update the note accordingly.

(In reply to Marco Castelluccio [:marco] from comment #7)

This is an addition on top of drawing and adding text, the earlier accessibility review happened in bug 1777257.

You can add an image by clicking on the relevant icon in the PDF viewer toolbar (the icon between download and add text, on the top right corner).

When I click on the icon, nothing happens. I assume a file-selection dialog is supposed to open?

EDIT: After spending some time on this with :ayeddi, we discovered you have to click the PDF canvas after clicking the image insertion button in order to place an image. This UX makes the feature difficult to discover -- is it possible to open the dialog when the button is clicked and then have the chosen image inserted in the document (in the middle of the active page) where it can then be resized and moved?

The image insertion icon button should remain active while the image insertion mode is active -- otherwise, there's no indication to the user that they're not in "regular" point-and-click mode. It'd be really helpful to have a tooltip or something that describes this feature's usage, especially if we're intent on keeping the ordering of "user clicks on the page and then selects an image". Escape should exit the image insertion mode and remove the active state from the icon button.

Does this feature exist in other browsers/PDF editors? Does our UX match?

I belive Anna has some additional comments about keyboard accessibility and alt text, which I'll defer to her on here.

ah my mistake, it looks like this button does get the active state when image mode is active, the contrast when compared to the neighbouring non-active buttons is extremely low, however (especially on macOS with increase contrast enabled). This needs to be updated.

On windows in HCM, the active state is more discernible, but there isn't an obvious change when you hover the active button. Also, the icon disappears when transitioning between active an inactive.

The feature is not accessible with a keyboard. At least I could not find the way to activate the file selection dialog, even when the keyboard focus was on one of the focusable elements (a link) within the PDF - pressing Space/Enter would activate that focusable element. Maybe, while the user is in the image injection mode, we could override the Enter key as it is overwritten for click and tap?

Note: the image injection mode remains active even after the image is injected, which I personally was not expecting, especially considering that the discoverability of the functionality (a need to click on the PDF to proceed with the action) was not clear.

If there is a keyboard shortcut for image injection when the button/mode is On, it should be documented within a reach (i.e. on the tooltip that :morgan has offered earlier).

There is no alt text creation or editing functionality provided. Moreover, an image is injected as <canvas> without any text alternative. MacOS VoiceOver guessed that it was an image, but it is not implied from the code. More information about a11y concerns for Canvas elements can be found on MDN and the resources linked there.

We have a few bugs open for some of the concerns you raised:

  • Bug 1844952 to support adding alt text. We need to figure out a good UI/UX for this, Adobe Acrobat supports it but it is not really discoverable.
  • Bug 1845088 to make "add image" accessible with a keyboard. The other "add text" and "draw" are also not accessible with a keyboard. We'd appreciate your help here: even if we make the buttons activable with a keyboard, how can users position the image/text in the right place?
  • Bug 1843293 about making the button directly open the file dialog.

In addition to those, we have bug 1845087 about accessibility. We have marked all of these with the "access" keyword, we hope you can help assign a severity.

Could you file other bugs you found and mark them as blocking bug 1774350?

I've cc'd Usama on this ticket because there are multiple a11y blockers (even without the alt-text requirement) that he needs to be aware of and (as necessary) help resolve.

We (me, Calixte, Usama, and Dasha) met yesterday about the feature in general, the current plan is to target 118 or 119.

Depends on: 1845087, 1845088, 1843293
Blocks: 1846099
Depends on: 1850797
Depends on: 1851489
Depends on: 1844952
Duplicate of this bug: 1854563
Assignee: nobody → cdenizet
Status: NEW → ASSIGNED
Attachment #9355787 - Attachment description: Bug 1843054 - Enable pdfjs.enableStampEditor in 119 r=#pdfjs-reviewers → Bug 1843054 - Enable pdfjs.enableStampEditor on Release r=#pdfjs-reviewers
Pushed by cdenizet@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8679018abbfe Enable pdfjs.enableStampEditor on Release r=pdfjs-reviewers,marco
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch

Comment on attachment 9355787 [details]
Bug 1843054 - Enable pdfjs.enableStampEditor on Release r=#pdfjs-reviewers

Beta/Release Uplift Approval Request

  • User impact if declined: Users won't enjoy the new "add image in a pdf" feature.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Self contained change and it has been tested by QA.
  • String changes made/needed: No
  • Is Android affected?: No
Attachment #9355787 - Flags: approval-mozilla-beta?

Comment on attachment 9355787 [details]
Bug 1843054 - Enable pdfjs.enableStampEditor on Release r=#pdfjs-reviewers

Approved for 119.0b4

Attachment #9355787 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified all the bugs mentioned in here (Bug 1845087, Bug 1845088, Bug 1850797, Bug 1851489, Bug 1790255, Bug 1843293, Bug 1844952) with Firefox 120.0a1 (20231004094640) and Firefox 119.0b4 (20231002091755) on macOS 12 ARM, Win 10 and Ubuntu 22.04.

Status: RESOLVED → VERIFIED
See Also: → 1858198
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: