microsoft / microsoft/calculator

Bring back insert-from-history

Open
#277 5 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

approved Enhancement help wanted Pri: 2
Dominant language
C#
Stars
31.1k
Forks
5.8k
PR merge metrics
No merged PRs in 30d

Description

Problem Statement
Easily insert result(s) from the history into an expression being composed, by simply clicking them.

Compared to typing out one single big expression using parenthesis, this proposal lets the user:

  • verify that results of sub-expressions look correct (in the history)
  • avoid duplication, for example in a ratio A / (A + B) , where A and B are the results of non-trivial expressions

Evidence or User Insights
Currently it is awkward and error-prone to reuse a results from history, and impossible(?) to combine results. This is a regression from the Win32 calculator, and differs from other software calculators with history (e.g. Android).

To illustrate, people familiar with other apps are likely to first wipe what they've written by clicking the history item. Being familiar with physical calculators they might next try something like:

  1. Click history item
  2. M+
  3. Start retyping the wiped expression

Huh, step 3 partially modified the history expression, weird. So before step 3 we needed to press ESC, fine. Start over. Oh no! There was now a value in memory and M+ doubled it. Right I should have used MS (but then, I have never owned a physical calculator with a MS button.) OK then: click MC (did I need to do that?) Press ESC. Start over again...

Even once the confusion is resolved, the process still takes a minimum of 3 steps, using 3 UI elements (the history item, MS, MR) where a single click could suffice. And it only works for one value.

Note that some scenarios are possible via Ctrl+C, but:

  • to Ctrl+C something from history wipes what you've typed - you still cannot combine history items
  • the UWP look does not make it obvious that Copy & Paste is available

Proposal
If an item is in the history (10*20 = 200) and a new expression is being typed...

  • ending in an operator (1 / ): clicking a history item should append the result (yielding: 1 / 200)
  • ending in an value (1 / 5): the final value should be replaced (1 / 200). This is for consistency with other buttons (like MR).

To overwrite the current expression, it should still be obvious and intuitive that you can click C or press ESC before clicking a history item - making both operations easily accessible.

Goals
To make the history pane more useful, via easy reuse of prior results.

Non-Goals
Inserting the entire expression from history into the current expression. (That would require a movable text cursor in the main expression editor, which is probably quite a UI departure.)

Low-Fidelity Concept
Constructing a 3rd expression from 2 prior expressions (by clicking them) in the Windows 7 Calculator:

win7_calc

Related

  • Editing expressions in the history list: #163

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the history pane and the expression currently being composed. Verify the proposed behavior for expressions ending in an operator versus a value, including combining multiple history results and preserving overwrite through C or Escape; done means the history item inserts or replaces the result as specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.