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

Any PowerPoint interaction through Office-JS is merged into one undo-history entry #5249

Open
1 task done
zartinn opened this issue Jan 8, 2025 · 2 comments
Open
1 task done
Assignees
Labels
Area: PowerPoint Issue related to PowerPoint add-ins Platform: Desktop Platform: macOS Type: product bug Bug in the Office Add-ins platform or Office JavaScript APIs

Comments

@zartinn
Copy link

zartinn commented Jan 8, 2025

Your Environment

  • Platform: Mac/Windows
  • Host: PowerPoint
  • Office version number: 16.91/16.92
  • Operating System: Sonoma 14.5
  • Used Framework: Next 14.2.3

Expected behavior

each PowerPoint interaction through Office-JS with PowerPoint.run() where we write something to the PowerPoint (not reading out though) should result in an individual undo entry

Current behavior

Multiple/separate PowerPoint.run() calls that writes/changes something to the PowerPoint are merged into one undo-history entry. Even if I would insert 100 slides or do other PowerPoint operations via Office-JS

Steps to reproduce

Simple example (but is reproducable with any other PowerPoint.run() call where something is written/changed to the PowerPoint

"use client"

export default function AppPage() {
    return (
        <div className="flex flex-col gap-2">
            <button onClick={addSlide}>Add Slide</button>
        </div>
    )
}

async function addSlide() {
    await PowerPoint.run(async function (context) {
        context.presentation.slides.add()
        await context.sync()
    })
}

Provide additional details

  1. Installed other Addins as well and I noticed the same exact problem
  2. Manual PowerPoint interaction (deleting an object, moving an object, ...) between two PowerPoint.run() calls result in separate undo history entries. (BUT only on Windows. On Mac this workaround does not help)
  3. Another Office-JS API Office.context.document.setSelectedDataAsync("Hello world", { coercionType: Office.CoercionType.Text }) always creates a new undo history entry. But this API is primitive and we can't control much with it.
  4. Trying to combine PowerPoint.run(), then setSelectedDataAsync and then again PowerPoint.run() still results in merged undo history entry for all PowerPoint.run() calls
    Screenshot 2025-01-08 at 12 27 09

Context

Having the possiblity to undo each write operation to PowerPoint would be good to revert the last operation and not 10 at once.

Useful logs

  • Short Video
Screen.Recording.2025-01-08.at.12.21.19.mov
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Jan 8, 2025
@guoms1 guoms1 added the Area: PowerPoint Issue related to PowerPoint add-ins label Jan 8, 2025
@guoms1 guoms1 self-assigned this Jan 8, 2025
@guoms1 guoms1 added Area: Common APIs Issues related to common apis Platform: Desktop Platform: macOS and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP Area: PowerPoint Issue related to PowerPoint add-ins labels Jan 8, 2025
@guoms1
Copy link

guoms1 commented Jan 8, 2025

Hi, @zartinn,

Thank you for your report! We’ve noted your issue and are currently investigating. We appreciate your patience and will get back to you as soon as we have more information.

Thank you for your understanding!

@guoms1 guoms1 added Type: product bug Bug in the Office Add-ins platform or Office JavaScript APIs Area: PowerPoint Issue related to PowerPoint add-ins labels Jan 9, 2025
@guoms1
Copy link

guoms1 commented Jan 9, 2025

Hi, @zartinn,

Thank you for reporting this issue regarding the undo history generated by Office.js in PowerPoint. I’ve successfully reproduced the problem on Windows and will involve the relevant experts to address it.

This issue has been added to our backlog under reference <#9670935>. While we currently don’t have specific timelines to share, please rest assured that it’s on our radar. We appreciate your patience and understanding in the meantime.

@guoms1 guoms1 removed the Area: Common APIs Issues related to common apis label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: PowerPoint Issue related to PowerPoint add-ins Platform: Desktop Platform: macOS Type: product bug Bug in the Office Add-ins platform or Office JavaScript APIs
Projects
None yet
Development

No branches or pull requests

2 participants