microsoft / microsoft/calculator

Enable free-form input of math expressions

Open
#620 5 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Problem Statement
Today, when you input an expression, you are committing previous input with each operator, which means that you cannot easily edit or undo what you have already committed. We also have a key mapping such that keyboard keys are mapped to specific button inputs. This means that to enter "cos()", you actually press o. This is unintuitive and makes entering equations difficult.

We also currently only support linear input, which means we display this:

x ^ 2 + √(2x)

instead of this:

image

Evidence or User Insights
Our current keyboard mapping is unintuitive and requires extensive documentation to educate users (#157). Not only is free-form input more intuitive, there have been several issues opened that would require support for it as a pre-requisite (e.g., #163, #519, #150).

Proposal
Enable free-form input across calculator modes, which means that users can place the cursor anywhere inside of an equation input box to edit the expression. This also means that users can type or paste in "cos(x)", which feels natural, as this is how you would write this expression up on a whiteboard.

Note: This is the same input behavior that we are going to have in graphing mode.

Goals

  • Users can input their equations with free-form input
  • Expressions are displayed in rich MathML styling format

Non-Goals

  • Build a parser (this is covered by #526, which is a prerequisite for this work)
  • Introduce new input methods other than keyboard (e.g., inking input is covered by #24)

Low-Fidelity Concept

image
Just an example of rendering as MathML

Requested Assignment
I'm just suggesting this idea. I don't want to implement it.

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 reviewing prerequisite issue #526 and how calculator modes currently accept and display equation input. Compare the proposal's free-form editing and MathML-rendering goals across modes; done means users can place the cursor in an equation, type or paste expressions such as "cos(x)", edit them, and see rich formatting.

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
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.