Skip to content

feat: recent-doc plugin.#3131

Open
Kokoro2336 wants to merge 65 commits intotauri-apps:v2from
Kokoro2336:feat/recent-doc
Open

feat: recent-doc plugin.#3131
Kokoro2336 wants to merge 65 commits intotauri-apps:v2from
Kokoro2336:feat/recent-doc

Conversation

@Kokoro2336
Copy link
Copy Markdown

@Kokoro2336 Kokoro2336 commented Nov 29, 2025

add recent documents api support for issue tauri-apps/tauri#14460
now only available for macos and windows

Closes tauri-apps/tauri#14567

@Kokoro2336 Kokoro2336 requested a review from a team as a code owner November 29, 2025 09:42
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 29, 2025

Package Changes Through b991589

There are 2 changes which include recent-doc with major, recent-doc-js with major

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.42 2.0.43
recent-doc 1.0.0 2.0.0
recent-doc-js 1.0.0 2.0.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Copy link
Copy Markdown
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! Didn't quite try it yet, just some early feedbacks from first glance

We'll also want to add this to the CI

https://github.com/tauri-apps/plugins-workspace/blob/v2/.github/workflows/test-rust.yml

@Legend-Master Legend-Master linked an issue Dec 24, 2025 that may be closed by this pull request
Kokoro2336 and others added 4 commits March 9, 2026 09:48
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
@Kokoro2336
Copy link
Copy Markdown
Author

Kokoro2336 commented Mar 9, 2026

Hi, sorry for being late! I've now apply all the suggestions to the plugin, please have a look at the changes!

@Legend-Master Legend-Master added new plugin Idea/Request for a new plugin status: waiting Waiting on author labels Mar 28, 2026
@Kokoro2336
Copy link
Copy Markdown
Author

Kokoro2336 commented Mar 28, 2026

@Legend-Master Hi, I've formatted the code and updated the branch. Please run the rest workflows for the branch.

@Kokoro2336
Copy link
Copy Markdown
Author

Kokoro2336 commented Mar 28, 2026

@Legend-Master Sorry for forgetting to fix the broken lockfile. New commit has been submitted. Please run it again.

@Legend-Master Legend-Master removed the status: waiting Waiting on author label Mar 28, 2026
Copy link
Copy Markdown
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

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

There're still some reviews unresolved from #3131 (review)

And we'll also want to add this to the CI

Just a note that the audit CI fails are unrelated

@Legend-Master
Copy link
Copy Markdown
Contributor

Add for the CI and change files (used to release plugins), you can take a look at #2019 and #2900

@Kokoro2336
Copy link
Copy Markdown
Author

Suggestions in the review applied.

@Kokoro2336
Copy link
Copy Markdown
Author

@Legend-Master But the audits in the CI failed. I've updated the dependencies in package.json, but it's confusing that the vulnerabilities are still detected.

@Kokoro2336
Copy link
Copy Markdown
Author

Add for the CI and change files (used to release plugins), you can take a look at #2019 and #2900

Ok, I'm workling on it.

@Kokoro2336
Copy link
Copy Markdown
Author

Kokoro2336 commented Mar 31, 2026

Screenshot 2026-03-31 225920 Screenshot 2026-03-31 230132

Now the apis seem working well. For add_recent_docment(), I still use SHAddToRecentDocs; For get_recent_document(), I use IApplicationDocumentList; For clear_recent_document(), I use IApplicationDestination.

@Kokoro2336
Copy link
Copy Markdown
Author

Kokoro2336 commented Apr 1, 2026

@Legend-Master The AutomaticDestination directory is now correctly add/get/clear through the 3 apis.

If you want to test it on your pc, please run pnpm run tauri build and run the .exe directly, since dev mode can't register file exts. And you might need to manually set the api.exe as default handler of file exts since I didn't add it in tauri.config.json.

There is only one problem left: The jump list in GUI menu doesn't flush after cleaning, though getRecentDocument() return [] after clearRecentDocument().

I've tried ICustomDestinationList, but it doesn't work for the plugin. It's related to the explorer's caches, and from some researches, no other explicit apis are available to clear the cache. So we might have to leave it unresolved for now. But it's not a big deal, because the underlying database AutomaticDestination is updated as expected. The jump list will update when calling addRecentDocument() and will not when calling clearRecentDocument().

For now the best way to flush it is to manually turn off the "Show recommended files in Start, recent files in File Explorer, and items in Jump Lists" button and turn back on, which will destroy all the apps' jump list and reset 'em. And this is a user-side action, irrelevant to our implementaion :-/.

@Legend-Master
Copy link
Copy Markdown
Contributor

All the methods seem to work for me now, trying with the installed version and selecting it as the file association of a test extension (.tauri-test)

There is only one problem left: The jump list in GUI menu doesn't flush after cleaning

Didn't have any problems from my testing, maybe it's related to if the app's installed or not?

Anyways, good job! Let's document the behaviors and requirements

And we could also expose these methods on the rust side

The Mac implementation will need a review from either @FabianLars or @lucasfernog

@Kokoro2336
Copy link
Copy Markdown
Author

Kokoro2336 commented Apr 1, 2026

Didn't have any problems from my testing, maybe it's related to if the app's installed or not?

Blame my machine. It's ok if it works on yours.

@Kokoro2336 Kokoro2336 changed the title feat: add recent document api support. feat: recent-doc plugin. Apr 1, 2026
@Kokoro2336
Copy link
Copy Markdown
Author

Kokoro2336 commented Apr 2, 2026

@FabianLars @lucasfernog Hi, now the new plugin is ready for testing on macos.

@Kokoro2336
Copy link
Copy Markdown
Author

Sorry, I forgot to sign my commits. So I take a force push to resign it.

@Kokoro2336
Copy link
Copy Markdown
Author

Kokoro2336 commented Apr 9, 2026

Screenshot 2026-04-09 at 11 08 18 AM Screenshot 2026-04-09 at 11 09 58 AM

@Legend-Master @FabianLars Hey, just a simple test on macos, the APIs works as expected too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new plugin Idea/Request for a new plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] Recent Items in Dock Menu [feat] Recent documents

2 participants