joplin icon indicating copy to clipboard operation
joplin copied to clipboard

Implement a plugin API to display a progress bar

Open laurent22 opened this issue 8 months ago • 0 comments

Like in VSCode. Maybe that could also be generalised so that we can use it for OCR or other long running processes.

Ref: https://discourse.joplinapp.org/t/the-joplin-plugin-api-should-consider-adding-a-function-similar-to-vscode-window-withprogress/38362/3?u=laurent

vscode.commands.registerCommand('joplin.test', async () => {
  await vscode.window.withProgress(
    {
      title: 'Test',
      location: vscode.ProgressLocation.Notification,
    },
    async (process) => {
      for (let i = 1; i <= 10; i++) {
        process.report({ increment: 1, message: `Processing ${i}` })
        await new Promise((resolve) => setTimeout(resolve, 1000))
      }
    },
  )
})

Kapture 2024-06-01 at 16.00.20|video

laurent22 avatar Jun 01 '24 11:06 laurent22