Skip to content

Math tools: a second app around the editor, with a scientific keypad - #39

Open
simonebortolin wants to merge 3 commits into
ccr-f0e25fb4-eczbl3-fencesfrom
ccr-f0e25fb4-eczbl3
Open

simonebortolin wants to merge 3 commits into
ccr-f0e25fb4-eczbl3-fencesfrom
ccr-f0e25fb4-eczbl3

Conversation

@simonebortolin

Copy link
Copy Markdown
Owner

Stack 2/4: editor fences fix → this → formulas → units.

A second sample app, a set of math tools around MathEditBox, on the desktop and in the browser:

  • samples/SharpEquations.Avalonia.MathTools.Demo: the desktop window. MathToolsView has a page per tool and is shared with the web page.
  • samples/SharpEquations.Avalonia.Browser.MathTools.Demo: WebAssembly. Like the web demo, it is not in the solution build. demo.yml publishes it under math/ of the GitHub Pages site.
  • Calculator page: function keys (sin…tanh, sin⁻¹, log, ln, log_b), powers and scripts, √, ⁿ√, a/b, |x|, n!, constants, ∑ ∏ ∫ d/dx lim, digits, operators, relations, and keys to move, delete, undo and build up. The equation is also shown as UnicodeMath and LaTeX.
  • How the keys type (CalculatorKeys): a key types into the editor as the keyboard does, so sin( waits for its argument and x² squares what is before the caret. Structures (a/b, √, the sum with its limits) are inserted with their slots, around the selection if there is one.

Tests

  • MathTools/CalculatorKeysTests: key sequences type the equation they show, every face parses, and every key types something.
  • MathTools/MathToolsWindowTests.KeypadTypesIntoTheEditor: the window opens and types sin(x)²+cos(x)²=1.
  • I published the browser project in Debug and opened it in Chromium: it loads and the keys work.

Generated by Claude Code

…cientific keypad

samples/SharpEquations.Avalonia.MathTools.Demo (desktop) and
samples/SharpEquations.Avalonia.Browser.MathTools.Demo (WebAssembly, published by
demo.yml under math/ of the site) share MathToolsView, a page per tool. The first
is the calculator: functions, powers, structures, constants, digits and operators
that type into a MathEditBox as the keyboard does (sin( waits for its argument,
x² squares what is before the caret, a/b and √ take the selection), with the
equation as UnicodeMath and LaTeX. Tests: the keys type the equation they show,
and the window opens and types sin(x)²+cos(x)²=1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyVio8afJsGwHW9i5v5HDs
@github-actions

Copy link
Copy Markdown

Pre-release 1.1.0-pr.39.109 is ready: https://github.com/simonebortolin/SharpEquations/releases/tag/pr-39-109-1

NuGet package of 7485c8d. Updated on every push, deleted when this PR is closed.

@simonebortolin
simonebortolin added this pull request to stack #34 November 11, 2026 19:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants