Skip to content

feat: add edit image from storage on mobile editors#70

Open
n-goncalves wants to merge 13 commits into
Euro-Office:mainfrom
n-goncalves:feat-add-edit-image-from-storage-mobile
Open

feat: add edit image from storage on mobile editors#70
n-goncalves wants to merge 13 commits into
Euro-Office:mainfrom
n-goncalves:feat-add-edit-image-from-storage-mobile

Conversation

@n-goncalves

@n-goncalves n-goncalves commented May 29, 2026

Copy link
Copy Markdown
Contributor

This PR allow to add and replace existing images using the storage server on mobile for documenteditor, presentationeditor and spreadsheeteditor.

image

Edit: force-pushed to close the modal when button is clicked on as that's what happens when choosing a local file.

@n-goncalves n-goncalves force-pushed the feat-add-edit-image-from-storage-mobile branch from 56b18c1 to 71ad435 Compare May 29, 2026 15:40
@juliusknorr juliusknorr requested a review from moodyjmz June 10, 2026 12:20
@juliusknorr juliusknorr added the enhancement New feature or request label Jun 10, 2026

@moodyjmz moodyjmz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @n-goncalves — looks good overall, and it matches how the desktop editors do it (DE/PE ImgApply, SSE asc_setGraphicObjectProps; put_ImageUrl is a valid alias of asc_putImageUrl in the cell SDK, so that's fine too). Nice touch putting the icon in common/.

One behavioural regression flagged inline — the missing-c fallback to "add" got dropped. It applies to all three editors; suggestions attached so it's a one-click fix.

Couple of non-blocking nits: changeCanRequestInsertImage is registered in makeObservable in the three stores but never called (the value is assigned directly in setConfigOptions), and indentation is off in the new JSX blocks in DE/PE view/add/AddImage.jsx.

Comment thread apps/documenteditor/mobile/src/controller/Main.jsx Outdated
Comment thread apps/presentationeditor/mobile/src/controller/Main.jsx Outdated
Comment thread apps/spreadsheeteditor/mobile/src/controller/Main.jsx Outdated
Comment thread apps/documenteditor/mobile/src/controller/Main.jsx Outdated
Comment thread apps/presentationeditor/mobile/src/controller/Main.jsx Outdated
Comment thread apps/spreadsheeteditor/mobile/src/controller/Main.jsx Outdated

@moodyjmz moodyjmz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left some comments

@n-goncalves

Copy link
Copy Markdown
Contributor Author

Thanks for the catch on the empty c arguments, it wasn't mentioned on the API documentation.

For the minor nitpicks, I have fixed the indentation in the new JSX blocks in DE/PE view/add/AddImage.jsx.
I have also removed the changeCanRequestInsertImage in appOptions.

I wrote the first iteration of this years ago, I assume I wanted to do something with it at first but never did.

@moodyjmz moodyjmz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for addressing all the previous round's suggestions — the dispatch fallback and the guard corrections are both clean.

Two things still to tidy:

1. PE view/add/AddImage.jsx</List> indent

The closing tag landed at 8-space indent while <List> and everything inside it sits at 12. DE got this right; PE just needs the closer brought in one level.

2. SSE storeAppOptions.jscanRequestInsertImage in makeObservable

Worth a quick check: the SSE store uses an explicit makeObservable call that enumerates each observable field. The diff doesn't show canRequestInsertImage being added to that block — only the class field and the setConfigOptions assignment. If it's actually absent, MobX won't track it for reactivity (plain JS property, observer components won't re-render on change). Functionally fine for a config-once value, but worth confirming the intent is deliberate — or adding canRequestInsertImage: observable to match the other config flags in that block.

Minor nit: there's a stray double blank line after onInsertByStorage in the PE and SSE add controllers — single blank is enough.

@n-goncalves n-goncalves requested a review from a team as a code owner June 24, 2026 11:39
@n-goncalves n-goncalves requested review from emberfiend and moodyjmz and removed request for a team June 24, 2026 11:39
n-goncalves and others added 12 commits June 24, 2026 13:42
Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
Co-authored-by: James Manuel <moodyjmz@users.noreply.github.com>
Signed-off-by: n-goncalves <35218229+n-goncalves@users.noreply.github.com>
Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
Co-authored-by: James Manuel <moodyjmz@users.noreply.github.com>
Signed-off-by: n-goncalves <35218229+n-goncalves@users.noreply.github.com>
Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
Co-authored-by: James Manuel <moodyjmz@users.noreply.github.com>
Signed-off-by: n-goncalves <35218229+n-goncalves@users.noreply.github.com>
Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
Co-authored-by: James Manuel <moodyjmz@users.noreply.github.com>
Signed-off-by: n-goncalves <35218229+n-goncalves@users.noreply.github.com>
Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
Co-authored-by: James Manuel <moodyjmz@users.noreply.github.com>
Signed-off-by: n-goncalves <35218229+n-goncalves@users.noreply.github.com>
Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
Co-authored-by: James Manuel <moodyjmz@users.noreply.github.com>
Signed-off-by: n-goncalves <35218229+n-goncalves@users.noreply.github.com>
Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
@n-goncalves n-goncalves force-pushed the feat-add-edit-image-from-storage-mobile branch from 3ae5e8b to a2d5e55 Compare June 24, 2026 11:42
@n-goncalves

Copy link
Copy Markdown
Contributor Author
  1. PE view/add/AddImage.jsx — indent

Resolved.

  1. SSE storeAppOptions.js — canRequestInsertImage in makeObservable

The canRequestInsertImage value in appOptions comes from the fact that the onRequestInsertImage event exists in the editor when creating the DocEditor in api.js#396
As that is supposed to be set only once, it should be fine leaving it as it is.

But if I look at similar variables like for instance canBrandingExt in the same file, that one is also set once, but is in the makeObservable so using the same style also makes sense. I've let it as is for now but am happy to change it.

You mention only the SSE storeAppOptions.js but that's also the case in DE and PE.

Minor nit: there's a stray double blank line after onInsertByStorage in the PE and SSE add controllers — single blank is enough.

Resolved for PE add controller. I have checked the SSE add controller but there is a single blank line there.

@moodyjmz

moodyjmz commented Jun 25, 2026

Copy link
Copy Markdown
Member

Looking good, one tiny, tiny thing

canRequestInsertImage is set once, however I think it should be observable like the others, per editor.

[editor]/src/store/appOptions.js

makeObservable(this, {
    ....
    canRequestInsertImage: observable,   // <<< add this
});

Once that's done, I'll approve and merge - if you agree with those changes :)

Signed-off-by: n-goncalves <n-goncalves@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants