Skip to content

feat(calculator): add calculator search provider#384

Merged
JammingBen merged 2 commits intomainfrom
feat/calculator-search-provider
Mar 13, 2026
Merged

feat(calculator): add calculator search provider#384
JammingBen merged 2 commits intomainfrom
feat/calculator-search-provider

Conversation

@dschmidt
Copy link
Copy Markdown
Contributor

Description

KRunner-style calculator for the search bar. Type = followed by a math expression (e.g. =4+5) to see the result with a copy-to-clipboard button. Uses mathjs for safe expression evaluation.

Screenshot_20260311_151521

Related Issue

  • Fixes <issue_link>

How Has This Been Tested?

  • dev stack
  • tests added

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@dschmidt dschmidt force-pushed the feat/calculator-search-provider branch from c08631f to 4031686 Compare March 12, 2026 08:54
Copy link
Copy Markdown
Member

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works just fine, thanks! 😍

The one thing I noticed is that using the calculator is technically a a11y violation because the search drop is defined with role="menu". The calculator however is not really a menu and therefore doesn't have menuitems. But IMO that's a flaw of the extension system, so it needs adjustments in Web first.

Comment thread packages/web-app-calculator/extension.d.ts Outdated
Comment thread packages/web-app-calculator/package.json Outdated
Comment thread packages/web-app-calculator/package.json Outdated
KRunner-style calculator for the search bar. Type `=` followed by a
math expression (e.g. `=4+5`) to see the result with a copy-to-clipboard
button. Uses mathjs for safe expression evaluation. Division by zero
shows a translated error message instead of silently returning no result.
@dschmidt dschmidt force-pushed the feat/calculator-search-provider branch from 4031686 to ed643d8 Compare March 13, 2026 10:13
@JammingBen JammingBen merged commit 5105e8f into main Mar 13, 2026
5 checks passed
@JammingBen JammingBen deleted the feat/calculator-search-provider branch March 13, 2026 12:41
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