Skip to content

Conversation

@krystian-panek-vmltech
Copy link
Collaborator

fixes #233

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for additional input display types (NUMERIC and DECIMAL) to fix issue #233. The changes extend the StringInput type system to support mobile-friendly keyboard types and ensures proper mapping between backend display values and frontend HTML input attributes.

Key changes:

  • Extended StringInput display type to include URL, TEL, EMAIL, NUMERIC, and DECIMAL options
  • Added helper functions to convert display types to HTML input type and inputMode attributes
  • Updated Java backend enum to include the new display types

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
ui.frontend/src/types/input.ts Extended StringInput display union type and added conversion helper functions
ui.frontend/src/components/CodeInput.tsx Updated TextField to use helper functions for type and inputMode attributes
core/src/main/java/dev/vml/es/acm/core/code/input/StringInput.java Added numeric() and decimal() methods and corresponding Display enum values

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
}

export function stringInputDisplayToMode(display: string): "url" | "tel" | "email" | "text" | "numeric" | "decimal" {
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

The function parameter should use the StringInput['display'] union type instead of 'string' for type safety. This would prevent invalid display values from being passed and ensure compile-time validation.

Copilot uses AI. Check for mistakes.
return input.type === 'KEY_VALUE_LIST';
}

export function stringInputDisplayToType(display: string): string {
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

The function parameter should use the StringInput['display'] union type instead of 'string', and the return type should be narrowed to 'password' | 'url' | 'tel' | 'email' | 'text' for better type safety.

Suggested change
export function stringInputDisplayToType(display: string): string {
export function stringInputDisplayToType(
display: StringInput['display']
): 'password' | 'url' | 'tel' | 'email' | 'text' {

Copilot uses AI. Check for mistakes.
@krystian-panek-vmltech krystian-panek-vmltech merged commit cdedf66 into main Oct 22, 2025
1 check passed
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.

StringInput types email, url and tel does nothing

2 participants