feat: improve scan UX — case normalization, lock-mode list, layout swap
- CodeParser: normalize scanned barcode to uppercase and trim whitespace to handle scanner hardware outputting lowercase or trailing characters - RegistrationPage: swap layout so location field is above zongpai field - Lock mode: zongpai display changes to scrollable list supporting multiple entries with swipe-to-delete and per-item delete buttons - Lock mode: batch submit when multiple zongpai numbers are queued - Show scanned barcode content in invalid code error messages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,8 +39,15 @@ void main() {
|
||||
final result = CodeParser.parse('TRANS-01');
|
||||
expect(result.type, CodeType.locationTransit);
|
||||
});
|
||||
test('rejects lowercase location code', () {
|
||||
expect(CodeParser.parse('a01-02-03').type, CodeType.invalid);
|
||||
test('normalizes lowercase zongpaiNo to uppercase', () {
|
||||
final result = CodeParser.parse('26b1');
|
||||
expect(result.type, CodeType.zongpaiNo);
|
||||
expect(result.value, '26B1');
|
||||
});
|
||||
test('normalizes lowercase location code to uppercase', () {
|
||||
final result = CodeParser.parse('a01-02-03');
|
||||
expect(result.type, CodeType.locationNormal);
|
||||
expect(result.value, 'A01-02-03');
|
||||
});
|
||||
test('rejects invalid code', () {
|
||||
expect(CodeParser.parse('HELLO123').type, CodeType.invalid);
|
||||
|
||||
Reference in New Issue
Block a user