Compare commits
15 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
b695da0076 | 2 weeks ago |
|
|
8f407e8aba | 2 weeks ago |
|
|
3474d9f649 | 2 weeks ago |
|
|
dcbfab4ab4 | 2 weeks ago |
|
|
b055624b2a | 2 weeks ago |
|
|
2ae8c6645a | 2 weeks ago |
|
|
d40b1235f9 | 2 weeks ago |
|
|
e8f121c944 | 2 weeks ago |
|
|
1b11af78e1 | 2 weeks ago |
|
|
b1f0adf80c | 2 weeks ago |
|
|
84738ca626 | 2 weeks ago |
|
|
93b472dda2 | 2 weeks ago |
|
|
76a9529b83 | 2 weeks ago |
|
|
2977e26c82 | 2 weeks ago |
|
|
c54de927ef | 2 weeks ago |
@ -0,0 +1,205 @@
|
||||
# Application Architecture
|
||||
|
||||
Windows Calculator is a [C++/CX][C++/CX] application, built for the Universal Windows Platform ([UWP][What is UWP?]).
|
||||
Calculator uses the [XAML][XAML Overview] UI framework, and the project follows the Model-View-ViewModel ([MVVM][MVVM])
|
||||
design pattern. This document discusses each of the layers and how they are related to the three Visual Studio projects
|
||||
that build into the final Calculator application.
|
||||
|
||||
--------------------
|
||||
## Table of Contents
|
||||
|
||||
* [View](#view)
|
||||
* [VisualStates](#visualstates)
|
||||
* [Data-Binding](#data-binding)
|
||||
* [ViewModel](#viewmodel)
|
||||
* [PropertyChanged Events](#propertychanged-events)
|
||||
* [Model](#model)
|
||||
|
||||
--------------------
|
||||
|
||||
## View
|
||||
|
||||
The View layer is contained in the [Calculator project][Calculator folder]. This project contains mostly XAML files
|
||||
and various custom controls that support the UI. [App.xaml][App.xaml] contains many of the [static][StaticResource] and
|
||||
[theme][ThemeResource] resources that the other XAML files will reference. Its code-behind file, [App.xaml.cs][App.xaml.cs],
|
||||
contains the main entry point to the application. On startup, it navigates to the main page.
|
||||
|
||||
```C#
|
||||
rootFrame.Navigate(typeof(MainPage), argument)
|
||||
```
|
||||
|
||||
In Calculator, there is only one concrete [Page][Page] class: [MainPage.xaml][MainPage.xaml]. `MainPage` is the root
|
||||
container for all the other application UI elements. As you can see, there's not much content. `MainPage` uses a
|
||||
`NavigationView` control to display the toggleable navigation menu, and empty containers for delay-loaded UI elements.
|
||||
Of the many modes that Calculator shows in its menu, there are actually only three XAML files that `MainPage` needs to
|
||||
manage in order to support all modes. They are:
|
||||
|
||||
* [Calculator.xaml][Calculator.xaml]: This [UserControl] is itself a container for the [Standard][CalculatorStandardOperators.xaml],
|
||||
[Scientific][CalculatorScientificOperators.xaml], and [Programmer][CalculatorProgrammerOperators.xaml] modes.
|
||||
* [DateCalculator.xaml][DateCalculator.xaml]: Everything needed for the DateCalculator mode.
|
||||
* [UnitConverter.xaml][UnitConverter.xaml]: One `UserControl` to support every Converter mode.
|
||||
|
||||
### VisualStates
|
||||
|
||||
[VisualStates][VisualState] are used to change the size, position, and appearance ([Style][Style]) of UI elements
|
||||
in order to create an adaptive, responsive UI. A transition to a new `VisualState` is often triggered by specific
|
||||
window sizes. Here are a few important examples of `VisualStates` in Calculator. Note that it is not a
|
||||
complete list. When making UI changes, make sure you are considering the various `VisualStates` and layouts that
|
||||
Calculator defines.
|
||||
|
||||
#### History/Memory Dock Panel expansion
|
||||
|
||||
In the Standard, Scientific, and Programmer modes, the History/Memory panel is exposed as a flyout in small window sizes.
|
||||
Once the window is resized to have enough space, the panel becomes docked along the edge of the window.
|
||||
|
||||
<img src="Images\VisualStates\Standard1.gif" height="400" />
|
||||
|
||||
#### Scientific mode, inverse function button presence
|
||||
|
||||
In the Scientific mode, for small window sizes there is not enough room to show all the function buttons. The mode
|
||||
hides some of the buttons and provides a Shift (↑) button to toggle the visibility of the collapsed rows. When the
|
||||
window size is large enough, the buttons are re-arranged to display all function buttons at the same time.
|
||||
|
||||
<img src="Images\VisualStates\Scientific1.gif" height="400" />
|
||||
|
||||
#### Unit Converter aspect ratio adjustment
|
||||
|
||||
In the Unit Converter mode, the converter inputs and the numberpad will re-arrange depending on if the window is in
|
||||
a Portrait or Landscape aspect ratio.
|
||||
|
||||
<img src="Images\VisualStates\Converter1.gif" height="400" />
|
||||
|
||||
### Data-Binding
|
||||
|
||||
Calculator uses [data binding][Data Binding] to dynamically update the properties of UI elements. If this concept
|
||||
is new for you, it's also worth reading about [data binding in depth][Data binding in depth].
|
||||
|
||||
The [x:Bind][x:Bind] markup extension is a newer replacement for the older [Binding][Binding] style. You may see both
|
||||
styles in the Calculator codebase. Prefer `x:Bind` in new contributions because it has better performance. If you need
|
||||
to add or modify an existing `Binding`, updating to `x:Bind` is a great first step. Make sure to read and understand
|
||||
the difference between the two styles, as there are some subtle behavioral changes. Refer to the
|
||||
[binding feature comparison][BindingComparison] to learn more.
|
||||
|
||||
------------
|
||||
## ViewModel
|
||||
|
||||
The ViewModel layer is contained in the [CalcViewModel][CalcViewModel folder] project. ViewModels provide a source of
|
||||
data for the UI to bind against and act as the intermediary separating pure business logic from UI components that
|
||||
should not care about the model's implementation. Just as the View layer consists of a hierarchy of XAML files, the
|
||||
ViewModel consists of a hierarchy of ViewModel files. The relationship between XAML and ViewModel files is often 1:1.
|
||||
Here are the notable ViewModel files to start exploring with:
|
||||
|
||||
* [ApplicationViewModel.h][ApplicationViewModel.h]: The ViewModel for [MainPage.xaml][MainPage.xaml]. This ViewModel
|
||||
is the root of the other mode-specific ViewModels. The application changes between modes by updating the `Mode` property
|
||||
of the `ApplicationViewModel`. The ViewModel will make sure the appropriate ViewModel for the new mode is initialized.
|
||||
* [StandardCalculatorViewModel.h][StandardCalculatorViewModel.h]: The ViewModel for [Calculator.xaml][Calculator.xaml].
|
||||
This ViewModel exposes functionality for the main three Calculator modes: Standard, Scientific, and Programmer.
|
||||
* [DateCalculatorViewModel.h][DateCalculatorViewModel.h]: The ViewModel for [DateCalculator.xaml][DateCalculator.xaml].
|
||||
* [UnitConverterViewModel.h][UnitConverterViewModel.h]: The ViewModel for [UnitConverter.xaml][UnitConverter.xaml].
|
||||
This ViewModel implements the logic to support every converter mode, including Currency Converter.
|
||||
|
||||
### PropertyChanged Events
|
||||
|
||||
In order for [data binding](#data-binding) to work, ViewModels need a way to inform the XAML framework about
|
||||
updates to their member properties. Most ViewModels in the project do so by implementing the
|
||||
[INotifyPropertyChanged][INotifyPropertyChanged] interface. The interface requires that the class provides a
|
||||
[PropertyChanged event][PropertyChanged]. Clients of the ViewModel (such as the UI), can register for the
|
||||
`PropertyChanged` event from the ViewModel, then re-evaluate bindings or handle the event in code-behind when the
|
||||
ViewModel decides to raise the event. ViewModels in the Calculator codebase generally uses a macro, defined in the
|
||||
[Utils.h][Utils.h] utility file, to implement the `INotifyPropertyChanged` interface. Here is a standard
|
||||
implementation, taken from [ApplicationViewModel.h][ApplicationViewModel.h].
|
||||
|
||||
```C++
|
||||
[Windows::UI::Xaml::Data::Bindable]
|
||||
public ref class ApplicationViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
||||
{
|
||||
public:
|
||||
ApplicationViewModel();
|
||||
|
||||
OBSERVABLE_OBJECT();
|
||||
```
|
||||
|
||||
The `OBSERVABLE_OBJECT()` macro defines the required `PropertyChanged` event. It also defines a private
|
||||
`RaisePropertyChanged` helper function for the class. The function takes a property name and raises a
|
||||
`PropertyChanged` event for that property.
|
||||
|
||||
Properties that are intended to be the source for a data binding are also typically implemented with a macro. Here is
|
||||
one such property from `ApplicationViewModel`:
|
||||
|
||||
```C++
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String^, CategoryName);
|
||||
```
|
||||
|
||||
The `OBSERVABLE_PROPERTY_RW` macro defines a Read/Write property that will raise a `PropertyChanged` event if its value
|
||||
changes. Read/Write means the property exposes both a public getter and setter. For efficiency and to avoid raising
|
||||
unnecessary `PropertyChanged` events, the setter for these types of properties will check if the new value is
|
||||
different from the previous value before raising the event.
|
||||
|
||||
From this example, either `ApplicationViewModel` or clients of the class can simply assign to the `CategoryName`
|
||||
property and a `PropertyChanged` event will be raised, allowing the UI to respond to the new `CategoryName` value.
|
||||
|
||||
--------
|
||||
## Model
|
||||
|
||||
The Model for the Calculator modes is contained in the [CalcManager][CalcManager folder] project. It consists of three layers: a `CalculatorManager`, which relies on a `CalcEngine`, which relies on the `Ratpack`.
|
||||
|
||||
### CalculatorManager
|
||||
|
||||
The CalculatorManager contains the logic for managing the overall Calculator app's data such as the History and Memory lists, as well as maintaining the instances of calculator engines used for the various modes. The interface to this layer is defined in [CalculatorManager.h][CalculatorManager.h].
|
||||
|
||||
### CalcEngine
|
||||
|
||||
The CalcEngine contains the logic for interpreting and performing operations according to the commands passed to it. It maintains the current state of calculations and relies on the RatPack for performing mathematical operations. The interface to this layer is defined in [CalcEngine.h][CalcEngine.h].
|
||||
|
||||
### RatPack
|
||||
|
||||
The RatPack (short for Rational Pack) is the core of the Calculator model and contains the logic for
|
||||
performing its mathematical operations (using [infinite precision][Infinite Precision] arithmetic
|
||||
instead of regular floating point arithmetic). The interface to this layer is defined in [ratpak.h][ratpak.h].
|
||||
|
||||
[References]:####################################################################################################
|
||||
|
||||
[C++/CX]: https://docs.microsoft.com/en-us/cpp/cppcx/visual-c-language-reference-c-cx
|
||||
[What is UWP?]: https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide
|
||||
[XAML Overview]: https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/xaml-overview
|
||||
[MVVM]: https://docs.microsoft.com/en-us/windows/uwp/data-binding/data-binding-and-mvvm
|
||||
|
||||
[Calculator folder]: ../src/Calculator
|
||||
[App.xaml]: ../src/Calculator/App.xaml
|
||||
[App.xaml.cs]: ../src/Calculator/App.xaml.cs
|
||||
[StaticResource]: https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/staticresource-markup-extension
|
||||
[ThemeResource]: https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/themeresource-markup-extension
|
||||
[Page]: https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.Page
|
||||
[UserControl]: https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.UserControl
|
||||
[MainPage.xaml]: ../src/Calculator/Views/MainPage.xaml
|
||||
[Calculator.xaml]: ../src/Calculator/Views/Calculator.xaml
|
||||
[CalculatorStandardOperators.xaml]: ../src/Calculator/Views/CalculatorStandardOperators.xaml
|
||||
[CalculatorScientificOperators.xaml]: ../src/Calculator/Views/CalculatorScientificOperators.xaml
|
||||
[CalculatorProgrammerOperators.xaml]: ../src/Calculator/Views/CalculatorProgrammerOperators.xaml
|
||||
[DateCalculator.xaml]: ../src/Calculator/Views/DateCalculator.xaml
|
||||
[UnitConverter.xaml]: ../src/Calculator/Views/UnitConverter.xaml
|
||||
|
||||
[VisualState]: https://docs.microsoft.com/en-us/windows/uwp/design/layout/layouts-with-xaml#adaptive-layouts-with-visual-states-and-state-triggers
|
||||
[Style]: https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/xaml-styles
|
||||
|
||||
[Data Binding]: https://docs.microsoft.com/en-us/windows/uwp/data-binding/data-binding-quickstart
|
||||
[Data binding in depth]: https://docs.microsoft.com/en-us/windows/uwp/data-binding/data-binding-in-depth
|
||||
[x:Bind]: https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/x-bind-markup-extension
|
||||
[Binding]: https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/binding-markup-extension
|
||||
[BindingComparison]: https://docs.microsoft.com/en-us/windows/uwp/data-binding/data-binding-in-depth#xbind-and-binding-feature-comparison
|
||||
|
||||
[CalcViewModel folder]: ../src/CalcViewModel
|
||||
[ApplicationViewModel.h]: ../src/CalcViewModel/ApplicationViewModel.h
|
||||
[StandardCalculatorViewModel.h]: ../src/CalcViewModel/StandardCalculatorViewModel.h
|
||||
[DateCalculatorViewModel.h]: ../src/CalcViewModel/DateCalculatorViewModel.h
|
||||
[UnitConverterViewModel.h]: ../src/CalcViewModel/UnitConverterViewModel.h
|
||||
|
||||
[INotifyPropertyChanged]: https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.data.inotifypropertychanged
|
||||
[PropertyChanged]: https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.data.inotifypropertychanged.propertychanged
|
||||
[Utils.h]: ../src/CalcViewModel/Common/Utils.h
|
||||
|
||||
[CalcManager folder]: ../src/CalcManager
|
||||
[CalculatorManager.h]: ../src/CalcManager/CalculatorManager.h
|
||||
[CalcEngine.h]: ../src/CalcManager/Header Files/CalcEngine.h
|
||||
[Infinite Precision]: https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic
|
||||
[ratpak.h]: ../src/CalcManager/Ratpack/ratpak.h
|
||||
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 3.0 MiB |
@ -0,0 +1,113 @@
|
||||
# New feature process
|
||||
|
||||
## Where do I submit my idea for a new feature?
|
||||
The easiest way to submit new feature requests is through
|
||||
[Feedback Hub](https://insider.windows.com/en-us/fb/?contextid=130).
|
||||
In Feedback Hub, any Windows user (even if they aren't on GitHub) can upvote suggestions. The
|
||||
Calculator team reviews these suggestions regularly, and when we're ready to work on an idea we
|
||||
create [feature pitch issues here on GitHub](https://github.com/Microsoft/calculator/issues?q=is%3Aissue+is%3Aopen+project%3AMicrosoft%2Fcalculator%2F1).
|
||||
|
||||
But using Feedback Hub is not required—_you_ can create feature pitches too! This document
|
||||
explains the elements of a good pitch and how we'll guide features from a pitch to a finished
|
||||
product. The [Feature Tracking board](https://github.com/Microsoft/calculator/projects/1) shows
|
||||
all the features we're working on and where they're at in the process.
|
||||
|
||||
## Do I need to follow this process? Can I just start coding and submit a PR?
|
||||
You **do not** need to follow this process for bug fixes, performance improvements, or changes to the
|
||||
development tools. To contribute these changes,
|
||||
[discuss the proposed change in an issue](https://github.com/Microsoft/calculator/issues/new)
|
||||
and then submit a pull request.
|
||||
|
||||
You **do** need to follow this process for any change which "users will notice". This applies
|
||||
especially to new features and major visual changes.
|
||||
|
||||
## Step 1: Feature pitch
|
||||
Feature pitches are submitted as issues on GitHub using the
|
||||
[Feature Request template](https://github.com/Microsoft/calculator/issues/new?assignees=&labels=&template=feature_request.md&title=).
|
||||
We encourage discussion on open issues, and as discussion progresses we will edit the issue description to refine the
|
||||
idea until it is ready for review.
|
||||
|
||||
We review pitches regularly, and will approve or close issues based on whether they broadly align with the
|
||||
[Calculator roadmap](https://github.com/Microsoft/calculator/blob/master/docs/Roadmap.md). Approved pitches are moved
|
||||
into [planning](https://github.com/Microsoft/calculator/projects/1) on the feature tracking board.
|
||||
|
||||
## Step 2: Planning
|
||||
For most features, the output of this phase is a specification which describes how the feature will work, supported by
|
||||
design renderings and code prototypes as needed. The original issue will continue to track the overall progress of the
|
||||
feature, but we will create and iterate on spec documentation in the
|
||||
[Calculator Spec repo](https://github.com/Microsoft/calculator-specs). Sometimes we'll learn new things about a feature
|
||||
proposal during planning, and we'll edit or close the original pitch.
|
||||
|
||||
We welcome community participation throughout planning. The best ideas often come from trying many ideas during
|
||||
the planning phase. To enable rapid
|
||||
experimentation, we encourage developing and sharing rough ideas—maybe even with pencil and
|
||||
paper—before making designs pixel-perfect or making code robust and maintainable.
|
||||
|
||||
After the [spec review](https://github.com/Microsoft/calculator-specs#spec-review) is completed, we will move the issue
|
||||
into [implementation](https://github.com/Microsoft/calculator/projects/1) on the feature tracking board. In _some_ cases,
|
||||
all of the details of an idea can be captured concisely in original feature pitch. When that happens, we may move ideas
|
||||
directly into implementation.
|
||||
|
||||
## Step 3: Implementation
|
||||
A feature can be implemented by the original submitter, a Microsoft team member, or by other
|
||||
community members. Code contributions and testing help are greatly appreciated. Please let everyone know if you're
|
||||
actively working on a feature to help avoid duplicated efforts from others.
|
||||
|
||||
You might be able to reuse code written during the prototype process, although there will typically
|
||||
be more work required to make the solution robust. Once the code is ready, you can begin
|
||||
[submitting pull requests](../CONTRIBUTING.md).
|
||||
|
||||
### Technical review
|
||||
As with all changes, the code for new features will be reviewed by a member of the Microsoft team
|
||||
before being checked in to the master branch.
|
||||
|
||||
New features often need a more thorough technical review than bug fixes. When reviewing code for
|
||||
new features, the Microsoft team considers at least these items:
|
||||
|
||||
- [ ] All items on the [Accessibility checklist](https://docs.microsoft.com/en-us/windows/uwp/design/accessibility/accessibility-checklist)
|
||||
should be addressed.
|
||||
- [ ] All items on the [Globalization checklist](https://docs.microsoft.com/en-us/windows/uwp/design/globalizing/guidelines-and-checklist-for-globalizing-your-app)
|
||||
should be addressed.
|
||||
- [ ] The change should be tested on the oldest version of Windows that the app supports. You can
|
||||
find this version number in AppxManifest.xml. Any calls to APIs newer than that version should be
|
||||
[conditionally enabled](https://docs.microsoft.com/en-us/windows/uwp/debug-test-perf/version-adaptive-apps).
|
||||
- [ ] The change should use only supported APIs. If there are any questions about whether legacy or
|
||||
undocumented APIs are in use, the [Windows App Certification Kit](https://docs.microsoft.com/en-us/windows/uwp/debug-test-perf/windows-app-certification-kit)
|
||||
should be run to check.
|
||||
- [ ] The change should save the user's progress if the app is
|
||||
[suspended and resumed](https://docs.microsoft.com/en-us/windows/uwp/debug-test-perf/optimize-suspend-resume).
|
||||
Code to handle these cases should be
|
||||
[tested in the Visual Studio debugger](https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-trigger-suspend-resume-and-background-events-for-windows-store-apps-in-visual-studio).
|
||||
- [ ] If the change [has customizations for particular device families](https://docs.microsoft.com/en-us/uwp/extension-sdks/device-families-overview),
|
||||
it should be tested on those device families.
|
||||
- [ ] The change should be tested with the app window resized to the smallest possible size.
|
||||
- [ ] The change should be tested with light, dark, and high contrast themes. It should honor the
|
||||
user's preferred [accent color](https://docs.microsoft.com/en-us/windows/uwp/design/style/color#accent-color-palette).
|
||||
- [ ] If the change adds new libraries or other dependencies:
|
||||
- [ ] If the library is packaged with the app, the increased size of the binaries should be
|
||||
measured.
|
||||
- [ ] If the library is not maintained by Microsoft, the Microsoft team will need to set up a
|
||||
plan to monitor the upstream library for changes like security fixes.
|
||||
- [ ] If the library is being used under an open-source license, we must comply with the license
|
||||
and credit third parties appropriately.
|
||||
- [ ] If the change adds code which runs during the app's startup path, or adds new XAML elements
|
||||
which are loaded at startup:
|
||||
- [ ] Run the perf tests to measure any increase in startup time. Move work out of the startup
|
||||
path if possible.
|
||||
- [ ] If the change adds additional logging:
|
||||
- [ ] All logging should use
|
||||
[TraceLogging](https://docs.microsoft.com/en-us/windows/desktop/tracelogging/trace-logging-about).
|
||||
- [ ] Unnecessary log events should be removed, or configured so that they are collected only when
|
||||
needed to debug issues or measure feature usage.
|
||||
- [ ] If the change reads user data from files or app settings:
|
||||
- [ ] Verify that state saved in a previous version of the app can be used with the new version.
|
||||
- [ ] If the change makes network requests:
|
||||
- [ ] Microsoft must plan to keep these dependencies secure and functional for the lifetime of
|
||||
the app (which might be several years).
|
||||
- [ ] The app should be fully functional if some network requests are slow or fail. Tools like
|
||||
[Fiddler](https://docs.telerik.com/fiddler/knowledgebase/fiddlerscript/perftesting)
|
||||
can be used to simulate slow or failed requests.
|
||||
|
||||
## Step 4: Final product review and merge to master
|
||||
After the technical review is complete, the product team will review the finished product to make
|
||||
sure the final implementation is ready to [release to Windows customers](Roadmap.md#Releases).
|
||||
@ -0,0 +1,19 @@
|
||||
# Windows Calculator Roadmap
|
||||
|
||||
Windows Calculator is under active development by Microsoft.
|
||||
|
||||
## Focus
|
||||
|
||||
In 2021, the Windows Calculator team is focused on:
|
||||
* Iterating upon the existing app design based on the latest guidelines for [Fluent Design](https://developer.microsoft.com/en-us/windows/apps/design) and [WinUI](https://github.com/microsoft/microsoft-ui-xaml).
|
||||
* Unblocking community contributions by identifying and addressing bottlenecks affecting developers, including:
|
||||
* Migrating the codebase to C# ([#893](https://github.com/microsoft/calculator/issues/893))
|
||||
* Releasing infinite-precision engine as standalone package ([#1545](https://github.com/microsoft/calculator/issues/1545)) and adding support for arbitrary expression parsing ([#526](https://github.com/microsoft/calculator/issues/526))
|
||||
* Adding a settings page ([#596](https://github.com/microsoft/calculator/issues/596))
|
||||
* [Your feature idea here] - please review our [new feature development process](https://github.com/Microsoft/calculator/blob/main/docs/NewFeatureProcess.md) to get started!
|
||||
|
||||
We welcome contributions of all kinds from the community, but especially those that support the efforts above. Please see our [contributing guidelines](https://github.com/Microsoft/calculator/blob/main/CONTRIBUTING.md) for more information on how to get involved.
|
||||
|
||||
## Releases
|
||||
|
||||
Windows Calculator is included in every Windows 10 release as a [provisioned Windows app](https://docs.microsoft.com/en-us/windows/application-management/apps-in-windows-10#provisioned-windows-apps). We also deliver updates through the [Microsoft Store](https://www.microsoft.com/store/productId/9WZDNCRFHVN5) approximately monthly.
|
||||
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 3.1 MiB |
|
After Width: | Height: | Size: 206 KiB |
@ -0,0 +1,169 @@
|
||||
name: Windows Calculator Continuous Integration Pipeline
|
||||
run-name: WinCalc-CI-0.${{ github.run_number }}
|
||||
on:
|
||||
push:
|
||||
branches: [main, release/**, feature/**]
|
||||
pull_request:
|
||||
branches: [main, release/**, feature/**]
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
defineBuilds:
|
||||
name: Define builds
|
||||
runs-on: windows-latest
|
||||
env:
|
||||
isPR: ${{ github.event_name == 'pull_request' }}
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
platformList: ${{ steps.platformList.outputs.platformList }}
|
||||
unitTestPlatformList: ${{ steps.unitTestPlatformList.outputs.unitTestPlatformList }}
|
||||
steps:
|
||||
- name: Generate version number
|
||||
id: version
|
||||
run: |
|
||||
$version = "0.${{ github.run_number }}.${{ github.run_attempt }}.0"
|
||||
"version=`"$version`"" | Out-File $env:GITHUB_OUTPUT -Append
|
||||
shell: pwsh
|
||||
- name: Choose platforms to build
|
||||
id: platformList
|
||||
run: |
|
||||
if ($env:isPR -eq $false) {
|
||||
'platformList=["x64", "x86", "ARM64"]' | Out-File $env:GITHUB_OUTPUT -Append
|
||||
echo 'Build all platforms.'
|
||||
}
|
||||
else {
|
||||
'platformList=["x64"]' | Out-File $env:GITHUB_OUTPUT -Append
|
||||
echo 'Build x64 only.'
|
||||
}
|
||||
shell: pwsh
|
||||
- name: Choose platforms for unit test
|
||||
id: unitTestPlatformList
|
||||
run: |
|
||||
if ($env:isPR -eq $false){
|
||||
'unitTestPlatformList=["x64", "x86"]' | Out-File $env:GITHUB_OUTPUT -Append
|
||||
echo 'Test x64, x86'
|
||||
}
|
||||
else{
|
||||
'unitTestPlatformList=["x64"]' | Out-File $env:GITHUB_OUTPUT -Append
|
||||
echo 'Test x64'
|
||||
}
|
||||
shell: pwsh
|
||||
|
||||
build:
|
||||
needs: defineBuilds
|
||||
name: Build
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
platform: ${{ fromJSON(needs.defineBuilds.outputs.platformList) }}
|
||||
env:
|
||||
buildVersion: ${{ fromJSON(needs.defineBuilds.outputs.version) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: microsoft/setup-msbuild@v2
|
||||
name: Setup msbuild
|
||||
- uses: nuget/setup-nuget@v2
|
||||
name: Use nuget 6.x
|
||||
with:
|
||||
nuget-version: '6.x'
|
||||
- run: nuget restore ./src/Calculator.sln
|
||||
name: Restore nuget dependencies
|
||||
- run: |
|
||||
./build/scripts/UpdateAppxManifestVersion.ps1 `
|
||||
-AppxManifest ./src/Calculator/Package.appxmanifest `
|
||||
-Version ${{ env.buildVersion }}
|
||||
shell: pwsh
|
||||
name: Set version number in AppxManifest
|
||||
- run: |
|
||||
msbuild ./src/Calculator.sln `
|
||||
-bl:${{ github.workspace }}/output/Calculator.binlog `
|
||||
-p:OutDir=${{ github.workspace }}\output\ `
|
||||
-p:Platform=${{ matrix.platform }} `
|
||||
-p:Configuration=Release `
|
||||
-p:GenerateProjectSpecificOutputFolder=true `
|
||||
-p:Version=${{ env.buildVersion }} `
|
||||
-maxCpuCount `
|
||||
-t:Publish `
|
||||
-p:PublishDir=${{ github.workspace }}\output\publish\
|
||||
shell: pwsh
|
||||
name: Build calculator.sln
|
||||
- uses: actions/upload-artifact@v4
|
||||
name: Upload build outputs
|
||||
with:
|
||||
name: Build-${{ matrix.platform }}
|
||||
path: ${{ github.workspace }}/output
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Tools-${{ matrix.platform }}
|
||||
path: ${{ github.workspace }}/build/scripts/SignTestApp.ps1
|
||||
|
||||
unitTests:
|
||||
needs: [defineBuilds, build]
|
||||
runs-on: windows-latest
|
||||
name: Run unit tests
|
||||
strategy:
|
||||
matrix:
|
||||
platform: ${{ fromJSON(needs.defineBuilds.outputs.unitTestPlatformList) }}
|
||||
env:
|
||||
testDir: ${{ github.workspace }}/download/CalculatorUnitTests/AppPackages/CalculatorUnitTests_Test
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
name: Download build outputs
|
||||
with:
|
||||
name: Build-${{ matrix.platform }}
|
||||
path: ${{ github.workspace }}/download
|
||||
- uses: actions/download-artifact@v4
|
||||
name: Download tools
|
||||
with:
|
||||
name: Tools-${{ matrix.platform }}
|
||||
path: ${{ github.workspace }}/download/tools
|
||||
- run: |
|
||||
${{ github.workspace }}/download/tools/SignTestApp.ps1 -AppToSign ${{ env.testDir }}/CalculatorUnitTests.msix
|
||||
shell: pwsh
|
||||
name: Install test certificate
|
||||
- uses: ilammy/msvc-dev-cmd@v1 # this is a workaround because microsoft/vstest-action is broken.
|
||||
name: Setup dev tools
|
||||
- run: vstest.console.exe ${{ env.testDir }}/CalculatorUnitTests.msix /Platform:${{ matrix.platform }}
|
||||
name: Run unit tests
|
||||
|
||||
uiTests:
|
||||
needs: build
|
||||
runs-on: windows-latest
|
||||
name: Run UI tests (x64)
|
||||
env:
|
||||
appDir: ${{ github.workspace }}/download/Calculator/AppPackages/Calculator*_Test
|
||||
pubDir: ${{ github.workspace }}/download/publish
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
name: Download build outputs
|
||||
with:
|
||||
name: Build-x64
|
||||
path: ${{ github.workspace }}/download
|
||||
- uses: actions/download-artifact@v4
|
||||
name: Download tools
|
||||
with:
|
||||
name: Tools-x64
|
||||
path: ${{ github.workspace }}/download/tools
|
||||
- run: |
|
||||
Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
||||
shell: pwsh
|
||||
name: Set screen resolution
|
||||
- run: |
|
||||
${{ github.workspace }}/download/tools/SignTestApp.ps1 -AppToSign '${{ env.appDir }}/Calculator_*.msixbundle'
|
||||
${{ env.appDir }}/Add-AppDevPackage.ps1 -Force
|
||||
shell: powershell
|
||||
name: Install app
|
||||
- run: |
|
||||
Invoke-WebRequest 'https://github.com/microsoft/WinAppDriver/releases/download/v1.2.1/WindowsApplicationDriver_1.2.1.msi' `
|
||||
-OutFile (New-Item -Path '${{ github.workspace }}/download2/wad.msi' -Force)
|
||||
cd ${{ github.workspace }}/download2
|
||||
msiexec.exe /i wad.msi /quiet /passive
|
||||
shell: powershell
|
||||
name: Install WindowsApplicationDriver
|
||||
- uses: ilammy/msvc-dev-cmd@v1 # this is a workaround because microsoft/vstest-action is broken.
|
||||
name: Setup dev tools
|
||||
- run: |
|
||||
vstest.console.exe ${{ github.workspace }}\download\publish\CalculatorUITests.dll `
|
||||
/Platform:x64 `
|
||||
/Settings:${{ github.workspace }}\download\publish\CalculatorUITests.ci.runsettings
|
||||
shell: pwsh
|
||||
name: Run UI tests
|
||||
@ -0,0 +1,60 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report a problem with Calculator
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
<!--
|
||||
Before filing a bug
|
||||
- Ensure the bug reproduces on the latest version of the app.
|
||||
- Search existing issues and make sure this issue is not already filed.
|
||||
-->
|
||||
|
||||
**Describe the bug**
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
**Steps To Reproduce**
|
||||
<!--
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
-->
|
||||
|
||||
**Expected behavior**
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
**Screenshots**
|
||||
<!-- If applicable, add screenshots to help explain your problem. -->
|
||||
|
||||
**Device and Application Information**
|
||||
- OS Build:
|
||||
- Architecture:
|
||||
- Application Version:
|
||||
- Region:
|
||||
- Dev Version Installed:
|
||||
|
||||
<!--
|
||||
Run the following commands in Powershell and copy/paste the output.
|
||||
" - OS Build: $([Environment]::OSVersion.Version)"
|
||||
" - Architecture: $((Get-AppxPackage -Name Microsoft.WindowsCalculator).Architecture)"
|
||||
" - Application Version: $((Get-AppxPackage -Name Microsoft.WindowsCalculator).Version)"
|
||||
" - Region: $((Get-Culture).Name)"
|
||||
" - Dev Version Installed: $($null -ne (Get-AppxPackage -Name Microsoft.WindowsCalculator.Dev))"
|
||||
-->
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context about the problem here. -->
|
||||
|
||||
**Requested Assignment**
|
||||
<!--
|
||||
Some people just want to report a bug and let someone else fix it.
|
||||
Other people want to not only submit the bug report, but fix it as well.
|
||||
Both scenarios are completely ok. We just want to know which one it is.
|
||||
Please indicate which bucket you fall into by keeping one and removing the other.
|
||||
-->
|
||||
If possible, I would like to fix this.
|
||||
I'm just reporting this problem. I don't want to fix it.
|
||||
@ -0,0 +1,54 @@
|
||||
---
|
||||
name: Localization Suggestion
|
||||
about: Report a problem or suggested change to Calculator's localized content.
|
||||
title: '[Localization] '
|
||||
labels: 'Area: World-Readiness'
|
||||
assignees: ''
|
||||
---
|
||||
<!--
|
||||
PLEASE NOTE:
|
||||
We cannot _merge_ any suggested localization changes to our localized resources files. These files are automatically generated from an internal localization process. Any suggestion submitted this way will be duplicated into our internal localization system, and then closed here.
|
||||
|
||||
Alternatively, you can launch feedback-hub://, click on the "Language Community" tab on the left-side of the app, and follow the steps to submit a localization suggestion that way. (The "Language Community" tab currently will only be visible if your system is running a non-English language).
|
||||
|
||||
Before filing a bug
|
||||
- Ensure the bug reproduces on the latest version of the app.
|
||||
- Search existing issues and make sure this issue is not already filed.
|
||||
-->
|
||||
|
||||
**Describe the bug**
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
**Steps To Reproduce**
|
||||
<!--
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
-->
|
||||
|
||||
**Expected behavior**
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
**Screenshots**
|
||||
<!-- If applicable, add screenshots to help explain your problem. -->
|
||||
|
||||
**Device and Application Information**
|
||||
- OS Build:
|
||||
- Architecture:
|
||||
- Application Version:
|
||||
- Region:
|
||||
- Dev Version Installed:
|
||||
|
||||
<!--
|
||||
Run the following commands in Powershell and copy/paste the output.
|
||||
" - OS Build: $([Environment]::OSVersion.Version)"
|
||||
" - Architecture: $((Get-AppxPackage -Name Microsoft.WindowsCalculator).Architecture)"
|
||||
" - Application Version: $((Get-AppxPackage -Name Microsoft.WindowsCalculator).Version)"
|
||||
" - Region: $((Get-Culture).Name)"
|
||||
" - Dev Version Installed: $($null -ne (Get-AppxPackage -Name Microsoft.WindowsCalculator.Dev))"
|
||||
-->
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context about the problem here. -->
|
||||
@ -0,0 +1,16 @@
|
||||
## Fixes #.
|
||||
|
||||
|
||||
### Description of the changes:
|
||||
-
|
||||
-
|
||||
-
|
||||
|
||||
### How changes were validated:
|
||||
<!--Review https://github.com/Microsoft/calculator/blob/main/CONTRIBUTING.md and ensure all contributing requirements are met.
|
||||
|
||||
Specify how you tested your changes (i.e. manual/ad-hoc testing, automated testing, new automated tests added)-->
|
||||
-
|
||||
-
|
||||
-
|
||||
|
||||
@ -0,0 +1,135 @@
|
||||
id:
|
||||
name: GitOps.PullRequestIssueManagement
|
||||
description: GitOps.PullRequestIssueManagement primitive
|
||||
owner:
|
||||
resource: repository
|
||||
disabled: false
|
||||
where:
|
||||
configuration:
|
||||
resourceManagementConfiguration:
|
||||
scheduledSearches:
|
||||
- description:
|
||||
frequencies:
|
||||
- hourly:
|
||||
hour: 3
|
||||
filters:
|
||||
- isPullRequest
|
||||
- isOpen
|
||||
- hasLabel:
|
||||
label: needs author feedback
|
||||
- noActivitySince:
|
||||
days: 7
|
||||
- isNotLabeledWith:
|
||||
label: no recent activity
|
||||
actions:
|
||||
- addLabel:
|
||||
label: no recent activity
|
||||
- addReply:
|
||||
reply: This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **7 days**. Thank you for your contributions to Windows Calculator!
|
||||
eventResponderTasks:
|
||||
- if:
|
||||
- payloadType: Issue_Comment
|
||||
- hasLabel:
|
||||
label: no recent activity
|
||||
then:
|
||||
- removeLabel:
|
||||
label: no recent activity
|
||||
description:
|
||||
- if:
|
||||
- payloadType: Issues
|
||||
- isAction:
|
||||
action: Closed
|
||||
then:
|
||||
- removeLabel:
|
||||
label: needs pitch review
|
||||
- removeLabel:
|
||||
label: needs more info
|
||||
- removeLabel:
|
||||
label: needs spec
|
||||
- removeLabel:
|
||||
label: no recent activity
|
||||
- removeLabel:
|
||||
label: help wanted
|
||||
- removeLabel:
|
||||
label: needs spec review
|
||||
- removeLabel:
|
||||
label: needs spec
|
||||
description:
|
||||
triggerOnOwnActions: true
|
||||
- if:
|
||||
- payloadType: Pull_Request_Review
|
||||
- isAction:
|
||||
action: Submitted
|
||||
- isReviewState:
|
||||
reviewState: Changes_requested
|
||||
then:
|
||||
- addLabel:
|
||||
label: needs author feedback
|
||||
description:
|
||||
- if:
|
||||
- payloadType: Pull_Request
|
||||
- isActivitySender:
|
||||
issueAuthor: True
|
||||
- not:
|
||||
isAction:
|
||||
action: Closed
|
||||
- hasLabel:
|
||||
label: needs author feedback
|
||||
then:
|
||||
- removeLabel:
|
||||
label: needs author feedback
|
||||
description:
|
||||
- if:
|
||||
- payloadType: Issue_Comment
|
||||
- isActivitySender:
|
||||
issueAuthor: True
|
||||
- hasLabel:
|
||||
label: needs author feedback
|
||||
then:
|
||||
- removeLabel:
|
||||
label: needs author feedback
|
||||
description:
|
||||
- if:
|
||||
- payloadType: Pull_Request_Review
|
||||
- isActivitySender:
|
||||
issueAuthor: True
|
||||
- hasLabel:
|
||||
label: needs author feedback
|
||||
then:
|
||||
- removeLabel:
|
||||
label: needs author feedback
|
||||
description:
|
||||
- if:
|
||||
- payloadType: Pull_Request
|
||||
- not:
|
||||
isAction:
|
||||
action: Closed
|
||||
- hasLabel:
|
||||
label: no recent activity
|
||||
then:
|
||||
- removeLabel:
|
||||
label: no recent activity
|
||||
description:
|
||||
- if:
|
||||
- payloadType: Issue_Comment
|
||||
- hasLabel:
|
||||
label: no recent activity
|
||||
then:
|
||||
- removeLabel:
|
||||
label: no recent activity
|
||||
description:
|
||||
- if:
|
||||
- payloadType: Pull_Request_Review
|
||||
- hasLabel:
|
||||
label: no recent activity
|
||||
then:
|
||||
- removeLabel:
|
||||
label: no recent activity
|
||||
description:
|
||||
- if:
|
||||
- payloadType: Issue_Comment
|
||||
then:
|
||||
- cleanEmailReply
|
||||
description:
|
||||
onFailure:
|
||||
onSuccess:
|
||||
Loading…
Reference in new issue