-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Feature: Add Open With toolbar flyout #18581
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
0x5bfa
wants to merge
2
commits into
files-community:main
Choose a base branch
from
0x5bfa:fix-17291
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.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,111 @@ | ||
| # Repository Instructions | ||
| # Files Development Guidelines | ||
|
|
||
| This repository contains the Files Windows desktop app, a WinUI-based file manager for Windows. The codebase includes the main app, reusable controls, storage layers, Win32/CsWin32 interop, packaging support, background/server components, and UI/interaction tests. | ||
| This project is a C#/.NET WinUI 3 desktop app; an alternative to File Explorer. | ||
|
|
||
| ## Codebase Overview | ||
| - Protect context usage. Any command with unknown or potentially large output must be capped. Prefer targeted commands such as `rg`, `Get-Content -TotalCount`, `Select-Object -First`, or focused `git diff -- <path>`; for example, `COMMAND 2>&1 | Select-Object -First 200`. If a line cap is still too noisy, narrow the query instead of dumping full output. | ||
| - Always follow `.editorconfig` | ||
| - Keep changed text files in CRLF line endings | ||
| - Keep comments concise and useful. Do not add comments that restate obvious code. | ||
| - Never read entire generated files in `bin` or `obj` unless the generated source is directly needed. | ||
| - Prefer targeted search over full file reads. | ||
| - Touch only what you must. Clean up only files you created or changed for the task. | ||
| - Treat file operations, shell integration, drag/drop, preview handlers, archive actions, settings persistence, and localization as high-risk areas. | ||
| - For Win32, COM, Shell, clipboard, hotkey, and file operation interop, prefer `src/Files.App.CsWin32`, `NativeMethods.txt`, and existing wrappers/helpers. | ||
| - Avoid ad hoc P/Invoke declarations when CsWin32 or existing interop code can cover the API. | ||
| - Do not edit generated CsWin32 output directly. Update source declarations, wrappers, or generator inputs instead. | ||
| - For UI work, use existing XAML resources, controls, converters, commands, and localization patterns. Avoid one-off styles or hard-coded user-visible strings. | ||
| - Start by identifying the smallest relevant project, feature area, and files for the task. | ||
| - Read nearby code before adding new abstractions. Prefer existing WinUI, MVVM, service, command, and storage patterns. | ||
| - Keep implementation scoped to the requested behavior. Avoid opportunistic refactors, formatting churn, dependency updates, and generated file edits. | ||
| - Treat tool output as evidence. When behavior changes, run the focused build that can prove it and report anything left unverified. | ||
|
|
||
| ## Codebase Structure | ||
|
|
||
| ```text | ||
| /src | ||
| ├── Files.App // Main WinUI desktop app: startup, DI, views, view models, actions, services, dialogs, styles, assets, strings, and app helpers. | ||
| ├── Files.App.CsWin32 // CsWin32 source-generated Win32 interop. Add APIs to NativeMethods.txt here. | ||
| ├── Files.App.Controls // Reusable WinUI controls shared by the app. | ||
| ├── Files.App.Storage // App-facing storage abstractions and storage implementation pieces. | ||
| ├── Files.App.BackgroundTasks // Background task project. | ||
| ├── Files.App.Server // App service/server behavior. | ||
| ├── Files.App.Launcher // Launch-related entry points. | ||
| ├── Files.App.OpenDialog // File open dialog-specific app project/folder. | ||
| ├── Files.App.SaveDialog // File save dialog-specific app project/folder. | ||
| ├── Files.App (Package) // Packaging-related app project assets. | ||
| ├── Files.Core.Storage // Lower-level storage primitives that should not depend on the main WinUI app. | ||
| ├── Files.Core.SourceGenerator // Roslyn source generators used by the solution. | ||
| └── Files.Shared // Shared models, helpers, and code used by multiple projects. | ||
| ├── Files.App Main WinUI app | ||
| ├── Files.App.Controls Shared app controls | ||
| ├── Files.App.Storage App storage abstractions and implementations | ||
| ├── Files.App.CsWin32 Generated/native Win32 interop project | ||
| ├── Files.App.BackgroundTasks Background task project | ||
| ├── Files.App.Server App service/server project | ||
| ├── Files.Core.SourceGenerator Roslyn source generators and analyzers | ||
| ├── Files.Core.Storage Core storage abstractions | ||
| └── Files.Shared Shared attributes, extensions, and common code | ||
| ``` | ||
|
|
||
| ```text | ||
| /tests | ||
| ├── Files.App.UITests // UI test assets and views. | ||
| ├── Files.InteractionTests // Interaction tests used by CI automation. | ||
| └── Files.App.UnitTests // Placeholder/stale in this checkout; verify project files before assuming unit tests exist here. | ||
| ├── Files.App.UITests | ||
| ├── Files.App.UnitTests | ||
| └── Files.InteractionTests | ||
| ``` | ||
|
|
||
| ## When Dealing With Interop Code | ||
| ## Build | ||
|
|
||
| Prefer explicit platform/configuration builds. | ||
| Unless the task is specifically about resolving or inspecting warnings, add `-v:quiet -clp:ErrorsOnly` to `msbuild` commands so the log proves success or shows only actionable errors. | ||
|
|
||
| ```powershell | ||
| msbuild -restore Files.slnx -p:Configuration=Debug -p:Platform=x64 -v:quiet -clp:ErrorsOnly | ||
| ``` | ||
|
|
||
| If `msbuild` isn't available in the current shell, run it from Visual Studio Developer PowerShell. Match `-arch`, `-host_arch`, and `-p:Platform` to the platform you're verifying; use `x64` for x64 work and `arm64` for ARM64 work. | ||
|
|
||
| ```powershell | ||
| pwsh.exe -NoProfile -Command "& { | ||
| Import-Module 'C:\Program Files\Microsoft Visual Studio\18\Professional\Common7\Tools\Microsoft.VisualStudio.DevShell.dll' | ||
| Enter-VsDevShell 1ba2cc4e -SkipAutomaticLocation -DevCmdArguments '-arch=x64 -host_arch=x64' | ||
| msbuild -restore src/Files.App/Files.App.csproj -p:Configuration=Debug -p:Platform=x64 -v:quiet -clp:ErrorsOnly | ||
| }" | ||
| ``` | ||
|
|
||
| For focused C# work, build the affected project first. | ||
| Do not run build commands in parallel. | ||
|
|
||
| ```powershell | ||
| msbuild -restore src/Files.Shared/Files.Shared.csproj -p:Configuration=Debug -p:Platform=x64 -v:quiet -clp:ErrorsOnly | ||
| msbuild -restore src/Files.Core.SourceGenerator/Files.Core.SourceGenerator.csproj -p:Configuration=Debug -p:Platform=x64 -v:quiet -clp:ErrorsOnly | ||
| msbuild -restore src/Files.App/Files.App.csproj -p:Configuration=Debug -p:Platform=x64 -v:quiet -clp:ErrorsOnly | ||
| ``` | ||
|
|
||
| When the user asks to convert marshaled interop code into unmarshaled interop, or asks to remove trim-unsafe manual P/Invoke definitions, see [docs/interop-unmarshaled-conversion.md](docs/interop-unmarshaled-conversion.md). | ||
| ## Test | ||
|
|
||
| Prefer adding APIs and related generated types to `src/Files.App.CsWin32/NativeMethods.txt`, then update the callees to use CsWin32-generated `Windows.Win32.PInvoke` APIs directly. Do not leave manual `DllImport` definitions in place or replace them with local `LibraryImport` declarations when CsWin32 can generate the API. | ||
| We currently don't have a suitable set of tests for AI agents. Just make sure that the builds succeed. | ||
|
|
||
| ## When Building the App | ||
| ## Commit & Push | ||
|
|
||
| Use `.github/workflows/ci.yml` as the source of truth for building. | ||
| For normal local verification, build with MSBuild restore and explicit configuration/platform; packaging is not required. | ||
| When asked to commit, run these commands beforehand: | ||
|
|
||
| ```powershell | ||
| msbuild -restore src\Files.App\Files.App.csproj /p:Configuration=Debug /p:Platform=x64 | ||
| git status --short | ||
| git diff --check | ||
| ``` | ||
|
|
||
| ## When Packaging the App | ||
| Do not revert unrelated user changes. Stage only files that belong to the requested change. | ||
|
|
||
| Use concise commit messages that describe the behavior change, for example: | ||
|
|
||
| ```text | ||
| Add source-generated settings storage | ||
| ``` | ||
|
|
||
| ## Open a PR | ||
|
|
||
| When asked to open a PR, use a short PR title that names the behavior, not the implementation mechanics only, and prepend the PR type: | ||
|
|
||
| - "Fix": use this prefix when the linked issue is a bug | ||
| - "Feature": use this prefix when the linked issue is a feature request | ||
| - "Code Quality": anything else | ||
|
|
||
| The repository maintainers draft release notes based on these PR types: only fixes and feature requests are listed. | ||
|
|
||
| Good examples: | ||
|
|
||
| ```text | ||
| Fix: Fixed an issue where thumbnails wouldn't refresh when a file was updated | ||
| Feature: Add support for previewing AVI files in the Preview Pane | ||
| Code Quality: Add source-generated settings serialization | ||
| ``` | ||
|
|
||
| Use `.github/workflows/ci.yml` as the source of truth for packaging. Adjust `Configuration`, `Platform`, and `AppxBundlePlatforms` as needed. | ||
| For the PR body, follow `./.github/PULL_REQUEST_TEMPLATE.md`. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| AGENTS.md |
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.
Is there a reason the separator was removed?