-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Feature: Add ZIP encoding selection support for browsing archives with non-UTF-8 filenames #18529
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
Open
oxygen-dioxide
wants to merge
20
commits into
files-community:main
Choose a base branch
from
oxygen-dioxide:zip-encoding-oc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+725
−8
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
fc3d2c6
实现打开zip文件选择编码。目前问题:不显示文件夹,目录结构被展平
oxygen-dioxide d31bcaf
正常显示文件夹
oxygen-dioxide 722fb3c
可复制、打开文件,仍然无法打开子文件夹的文件
oxygen-dioxide 50cef74
Merge branch 'files-community:main' into zip-encoding-oc
oxygen-dioxide acaaa1a
编码选择框移动到右下角
oxygen-dioxide 851da52
formatting
oxygen-dioxide 6ca109c
Merge branch 'files-community:main' into zip-encoding-oc
oxygen-dioxide d0cb35f
Improved styling
yair100 18a2bb2
回退src/Files.App/ViewModels/UserControls/NavigationToolbarViewModel.cs
oxygen-dioxide b6881b0
ascii文件不显示编码选择框,处理非内置编码
oxygen-dioxide af1d4d8
Change CurrentEncoding property to non-static
oxygen-dioxide 814c90e
多zip编码管理。bug:切换标签页时变成null
oxygen-dioxide 8f1018a
修复切换页面时zip编码变为null
oxygen-dioxide 3d0b867
formatting
oxygen-dioxide f527168
修复打开zip文件时编码菜单编码不显示选中项
oxygen-dioxide df1ec06
Merge branch 'files-community:main' into zip-encoding-oc
oxygen-dioxide add308e
Merge branch 'files-community:main' into zip-encoding-oc
oxygen-dioxide 53f5dc4
GetBasicProperties: 支持不同编码
oxygen-dioxide d4dfc84
支持加密压缩包
oxygen-dioxide d234cfa
Merge branch 'files-community:main' into zip-encoding-oc
oxygen-dioxide File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be TwoWay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a ListView's
ItemsSourceis replaced (which happens every timeStatusBarViewModelis reassigned during a tab switch), the ListView internally resetsSelectedItem = null. With a TwoWay binding, this null propagates back to the ViewModel property, overwriting the previously selected encoding:This happens despite
UpdateZipEncodingStateAsync()already having restored the correct encoding synchronously earlier in the same UI cycle.Changing to
Mode=OneWaybreaks the ListView → ViewModel propagation path, preventing the spurious null write. The user's selection is still synced to the ViewModel via the existingItemClickhandler (called when the user picks an encoding from the flyout):https://github.com/oxygen-dioxide/Files/blob/3d0b867e34da179111a34691291fe28cf962d0d1/src/Files.App/UserControls/StatusBar.xaml.cs#L71-L77
ItemClick→SelectedZipEncoding.set→ triggersOnZipEncodingChangedAsync()→ stores the encoding and refreshes the view, just as before.The ViewModel → ListView direction (OneWay) still works, so on tab switch or encoding restore, the ListView correctly highlights the matching item from the ViewModel's
SelectedZipEncodingvalue.There is still a problem: when a zip file is opened, the detected zip encoding is shown on the button, but isn't shown as selected in the flyout menu. Let me fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should find the root cause and fix this to use the TwoWay binding.