Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e803063
Skyline: Convert WebClient use to HttpClient
Oct 10, 2025
cd95521
- More conversions of WebClient to HttpClient
Oct 11, 2025
caba79d
- Added the ToolStoreDlg and worked through a lot of consistency issues
Oct 13, 2025
7c578bb
Merge remote-tracking branch 'remotes/origin/master' into Skyline/wor…
Oct 13, 2025
ffc06aa
- revert OperationCanceledException handling in LongWaitDlg (per Nick…
Oct 13, 2025
ca68d42
- fix HttpClientWithProgress support for accessing LongWaitDlg.Cancel…
Oct 14, 2025
8917378
- add more testing of HttpClientWithProgress integration with LongWai…
Oct 15, 2025
eb30422
Merge branch 'master' into Skyline/work/20251010_webclient_replacement
brendanx67 Oct 15, 2025
76bc093
- more tests in HttpClientWithProgressIntegrationTest for fairly comp…
Oct 15, 2025
fdc966c
- fix code inspection error in HttpClientWithProgressIntegrationTest
Oct 15, 2025
8f19d9e
Merge branch 'master' into Skyline/work/20251010_webclient_replacement
brendanx67 Oct 16, 2025
4f71087
- updated .md files for LLM-assisted development
Oct 16, 2025
c381431
- Get 5 tests testing network failure and cancellation during downloa…
Oct 18, 2025
252bdc3
Merge remote-tracking branch 'remotes/origin/master' into Skyline/wor…
Oct 18, 2025
dbcf6bf
- clean up ToolUpdatesTest
Oct 19, 2025
e63173d
- fix cancellation when cancel button is clicked during a read operat…
Oct 19, 2025
5ac83b4
- clean up use of HttpClientWithProgress strings for testing to local…
Oct 19, 2025
849aadb
Merge branch 'master' into Skyline/work/20251010_webclient_replacement
brendanx67 Oct 19, 2025
4e8a305
Implement TODO directory structure with active/completed/backlog/arch…
Oct 19, 2025
a5ca814
Add PowerShell developer utilities to scripts/misc
Oct 19, 2025
15fa82d
Merge branch 'Skyline/work/20251010_webclient_replacement' of github.…
Oct 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 6 additions & 28 deletions .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ docs = [
- Use fenced code blocks only for relevant snippets or commands.
- Default to read-only discovery before edits; then apply focused edits.

[async_patterns]
# See STYLEGUIDE.md for comprehensive async/await guidelines
reference = "STYLEGUIDE.md"

[build_and_testing]
- LLM agents CANNOT build or run this project directly.
- Build and test operations must be performed by the developer using Visual Studio.
Expand All @@ -63,34 +67,8 @@ docs = [
- Do not attempt to run tests or execute the application.

[file_headers]
standard_header = """
/*
* Original author: [Author Name] <[email] .at. [domain]>,
* [Affiliation]
* AI assistance: Cursor (Claude Sonnet 4) <cursor .at. anysphere.co>
*
* Copyright [Year] University of Washington - Seattle, WA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
"""
ai_attribution = {
required = "Always include AI assistance line when code is created or significantly modified with AI tools"
format = "Cursor ([model names]) <cursor .at. anysphere.co>"
position = "After original author, before copyright"
email_format = "Use .at. format to avoid spam harvesting"
multiple_models = "List all models used if multiple AI systems contributed significantly"
}
# See STYLEGUIDE.md for file header format and AI attribution guidelines
reference = "STYLEGUIDE.md"

[testing]
# See STYLEGUIDE.md for comprehensive testing guidelines
Expand Down
43 changes: 42 additions & 1 deletion STYLEGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ Additional guidance:
- Enum members: `snake_case` (e.g., `not_set`).

## Whitespace and formatting
- Tabs are disallowed; use spaces. Do not change existing files indentation, but when adding new code use spaces.
- Tabs are disallowed; use spaces. Do not change existing files' indentation, but when adding new code use spaces.
- Avoid mixing tabs and spaces. Align with existing file formatting.
- **Line endings**: Use Windows-style line endings (`\r\n`, CRLF) for all files. This is the standard for Windows development and matches the team's development environment. When creating or modifying files, ensure line endings are `\r\n`, not Unix-style `\n` (LF).

## Tools
- We develop with Visual Studio 2022 and ReSharper; aim for warning-free under its inspections.
Expand Down Expand Up @@ -142,6 +143,46 @@ All source files should include the standard header with copyright and license i
- Existing files: Keep existing `u.washington.edu` format (no need to change)
- Both formats are acceptable

## Asynchronous programming patterns

### CRITICAL: No async/await keywords
- **DO NOT use `async`/`await` keywords** in C# code
- Use `AsyncUtil.RunAsync()` and `CommonAsyncUtil.RunAsync()` for background operations
- Use `Control.Invoke()` and `Control.BeginInvoke()` to return to UI thread
- See `DocumentationViewer.cs` for example implementation pattern

### Background operation pattern
```csharp
// Background operation with UI callback
CommonActionUtil.RunAsync(() =>
{
try
{
// Background work here
var result = DoBackgroundWork();

// Return to UI thread for updates
RunUI(() => UpdateUI(result));
}
catch (Exception ex)
{
RunUI(() => CommonAlertDlg.ShowException(this, ex));
}
});

private void RunUI(Action act)
{
Invoke(act);
}
```

### WebClient replacement pattern
When replacing WebClient with HttpClient:
- Maintain synchronous interface for existing callers
- Use `RunAsync()` to execute HTTP operations in background
- Use `Control.Invoke()` to return results to UI thread
- Preserve existing error handling patterns

## Testing guidelines

### Test project structure
Expand Down
2 changes: 2 additions & 0 deletions pwiz_tools/Shared/CommonUtil/CommonUtil.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Security" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
Expand Down Expand Up @@ -224,6 +225,7 @@
<Compile Include="Collections\IndexedSubList.cs" />
<Compile Include="SystemUtil\ConcurrencyVisualizer.cs" />
<Compile Include="SystemUtil\FormUtil.cs" />
<Compile Include="SystemUtil\HttpClientWithProgress.cs" />
<Compile Include="SystemUtil\Immutable.cs" />
<Compile Include="SystemUtil\IProgressMonitor.cs" />
<Compile Include="SystemUtil\LocalizationHelper.cs" />
Expand Down
63 changes: 63 additions & 0 deletions pwiz_tools/Shared/CommonUtil/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions pwiz_tools/Shared/CommonUtil/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,25 @@
<data name="FileEx_SafeDelete_Directory_could_not_be_found___0_" xml:space="preserve">
<value>Directory could not be found: {0}</value>
</data>
<data name="HttpClientWithProgress_MapHttpException_The_request_to__0__timed_out__Please_try_again_" xml:space="preserve">
<value>The request to {0} timed out. Please try again.</value>
</data>
<data name="HttpClientWithProgress_MapHttpException_No_network_connection_detected__Please_check_your_internet_connection_and_try_again_" xml:space="preserve">
<value>No network connection detected. Please check your internet connection and try again.</value>
</data>
<data name="HttpClientWithProgress_MapHttpException_Failed_to_resolve_host__0___Please_check_your_DNS_settings_or_VPN_proxy_" xml:space="preserve">
<value>Failed to resolve host {0}. Please check your DNS settings or VPN/proxy.</value>
</data>
<data name="HttpClientWithProgress_MapHttpException_Failed_to_connect_to__0___Please_check_your_network_connection__VPN_proxy__or_firewall_" xml:space="preserve">
<value>Failed to connect to {0}. Please check your network connection, VPN/proxy, or firewall.</value>
</data>
<data name="HttpClientWithProgress_MapHttpException_The_connection_was_lost_during_download__Please_check_your_internet_connection_and_try_again_" xml:space="preserve">
<value>The connection was lost during download. Please check your internet connection and try again.</value>
</data>
<data name="HttpClientWithProgress_ReadWithTimeout_The_read_operation_timed_out_while_downloading_from__0__" xml:space="preserve">
<value>The read operation timed out while downloading from {0}.</value>
</data>
<data name="HttpClientWithProgress_MapHttpException_server" xml:space="preserve">
<value>server</value>
</data>
</root>
Loading