Programmer Mode should support setting the radix based on pasted values
#58 opened on Feb 27, 2019
Repository metrics
- Stars
- (16,196 stars)
- PR merge metrics
- (Avg merge 15h 43m) (7 merged PRs in 30d)
Description
Problem Statement Calculator currently supports pasting in prefixed/suffixed values in programmer mode if the value is considered valid for the current radix (hex/dec/bin/oct).
Evidence or User Insights This is a small quality-of-life improvement when using programmer mode.
Proposal Upon paste in programmer mode, if invalid input is detected, attempt to detect if the value is valid in a radix other than the current one, and if so, automatically switch to that radix and accept pasted value.
Prefixes
- Pasted input with prefixes always automatically change to specified radix (e.g., "0b" = binary; "0x" = hex, etc.)
Suffixes
- If pasted input is valid in currently selected radix, prefer to remain in selected radix (e.g., pasting "10b" while in hex results in remaining in hex with "10B").
- If pasted input is invalid in currently selected radix and is valid in exactly one other radix, automatically change to specified radix (e.g., pasting "10F" in decimal is invalid and is only valid as hex input, so switch to hex).
- If pasted input is invalid in currently selected radix and is valid in more than one other radix, do not change radix and display "Cannot determine radix" (e.g., pasting "10b" in decimal is invalid, but is valid input for both binary ('b' suffix) and hex ("10B" is valid hex).
- If pasted input is invalid across radices, maintain current behavior and display "Invalid input".
Goals
- Minimize instances we display "Invalid Input" by automatically switching radix when we can do so confidently.
Non-Goals
- Add support for additional radix prefixes/suffixes.
Low-Fidelity Concept N/A (use existing UI; just switch radix when appropriate)
Requested Assignment I'm just suggesting this idea. I don't want to implement it.