Draft
Add light/dark theme toggle and new operators (power and square root)#21
Conversation
Co-authored-by: haslam93 <36418598+haslam93@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update UI to include light/dark theme and new operators
Add light/dark theme toggle and new operators (power and square root)
Oct 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements the UI improvements and new functionality requested in #[issue_number], adding a manual theme toggle and two new mathematical operators to enhance the calculator's capabilities.
Changes Made
🌓 Light/Dark Theme Toggle
Added a manual theme toggle button that allows users to switch between light and dark modes:
localStorageLight Mode:

Dark Mode:

🔢 New Mathematical Operators
Power Operator (^)
3^2 = 9,2^-2 = 0.25^key/arithmetic?operation=power&operand1=3&operand2=2Square Root Operator (√)
√9 = 3,√2.25 = 1.5/arithmetic?operation=sqrt&operand1=9&operand2=0Both operators are accessible via on-screen buttons and keyboard input, maintaining the calculator's existing interaction patterns.
Technical Details
Files Modified
api/controller.js: Addedpowerandsqrtoperations to the backend controllerpublic/client.js: Implemented theme toggle logic and handlers for new operatorspublic/default.css: Added theme toggle button styling and enhanced theme switching supportpublic/index.html: Added theme toggle button and new operator buttons to the UItest/arithmetic.test.js: Added 7 new test cases covering both operationsCode Quality
Accessibility Enhancements
Testing
The implementation includes comprehensive test coverage:
Example test cases:
Breaking Changes
None. This PR only adds new functionality without modifying existing behavior.
Related Issues
Closes #[issue_number]
Original prompt
Fixes #20
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.