Skip to content

feat: add defaultValue parameter to textPrompt#937

Merged
fortmarek merged 6 commits intomainfrom
feat/text-prompt-default-value
Feb 20, 2026
Merged

feat: add defaultValue parameter to textPrompt#937
fortmarek merged 6 commits intomainfrom
feat/text-prompt-default-value

Conversation

@fortmarek
Copy link
Copy Markdown
Member

@fortmarek fortmarek commented Feb 20, 2026

image

Summary

  • Adds an optional defaultValue: String? parameter to textPrompt across the Noorable protocol, Noora implementation, NooraMock, and the convenience extension
  • When the user submits empty input and a defaultValue is provided, the default is returned
  • While the cursor is active and input is empty, the default is shown as a muted placeholder
  • The resolved value (default or typed) is shown in the collapsed result

Test plan

  • Existing TextPromptTests pass (no behavior change when defaultValue is nil)
  • New test: returns_default_value_when_input_is_empty — verifies default is returned and rendered
  • New test: uses_typed_input_over_default_value — verifies typed input takes precedence

🤖 Generated with Claude Code

fortmarek and others added 2 commits February 20, 2026 09:08
When a defaultValue is provided and the user submits empty input, the
default is returned. While the cursor is active and input is empty, the
default is shown as a muted placeholder. The resolved value is displayed
in the collapsed result.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Display "Press Enter to use {default}" below the prompt instead of
inline with the input area. The hint disappears once the user starts
typing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fortmarek fortmarek changed the title Add defaultValue parameter to textPrompt feat: add defaultValue parameter to textPrompt Feb 20, 2026
fortmarek and others added 4 commits February 20, 2026 09:27
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The test used a nested Task with Task.sleep(20ms) to yield update data,
which raced with keystroke processing on the cooperative thread pool.
Yielding synchronously into the AsyncStream ensures the data is buffered
before iteration begins, eliminating the flaky scheduling dependency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fortmarek fortmarek marked this pull request as ready for review February 20, 2026 08:48
@fortmarek fortmarek requested a review from a team as a code owner February 20, 2026 08:48
@fortmarek fortmarek requested review from cschmatzler and removed request for a team February 20, 2026 08:48
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 20, 2026
@dosubot dosubot bot added lgtm This PR has been approved by a maintainer changelog:added labels Feb 20, 2026
@fortmarek fortmarek merged commit 47ed4be into main Feb 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:added lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants