Skip to content

Conversation

@zenoachtig
Copy link
Contributor

@zenoachtig zenoachtig commented Dec 10, 2025

Standardise on a new <Input> component that takes care of submitting, clearing, and validating. Can be controlled or uncontrolled, multiline (renders as textarea) or single-line (renders as input).

Untitled.1.mp4

All existing inputs on the site have been reworked with all functionality intact and minimal style changes.

PageFeedbackForm has been updated more substantially, using the new styling.
CleanShot 2025-12-12 at 15 16 55@2x

@changeset-bot
Copy link

changeset-bot bot commented Dec 10, 2025

🦋 Changeset detected

Latest commit: bbc25b6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
gitbook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@argos-ci
Copy link

argos-ci bot commented Dec 10, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 140 changed Dec 16, 2025, 6:33 PM
v2-cloudflare (Inspect) 👍 Changes approved 663 changed Dec 16, 2025, 6:38 PM
v2-vercel (Inspect) 👍 Changes approved 671 changed Dec 16, 2025, 6:37 PM

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

And make AIChatInput non-controlled.
Fixes RND-9035
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 introduces a standardized <Input> component that consolidates common input functionality including submission, clearing, validation, and keyboard shortcuts. The component supports both controlled/uncontrolled states and single-line/multiline modes.

Key changes:

  • New Input component with comprehensive features (submit buttons, clear buttons, keyboard shortcuts, validation)
  • Refactored existing inputs across the codebase (SearchInput, AIChatInput, PageFeedbackForm) to use the new component
  • Updated styling to maintain consistency across all input fields

Reviewed changes

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

Show a summary per file
File Description
packages/gitbook/src/components/primitives/index.ts Exports the new Input component
packages/gitbook/src/components/primitives/KeyboardShortcut.tsx Adds TypeScript types and adjusts icon sizing
packages/gitbook/src/components/primitives/Input.tsx Implements the new Input component with all core functionality
packages/gitbook/src/components/Search/SearchInput.tsx Refactored to use the new Input component
packages/gitbook/src/components/PageFeedback/PageFeedbackForm.tsx Simplified using Input component with built-in submit handling
packages/gitbook/src/components/DocumentView/Integration/contentkit.css Updated styles to match new Input component styling
packages/gitbook/src/components/AIChat/AIChatInput.tsx Refactored to use Input component, removing manual resize logic
packages/gitbook/src/components/AIChat/AIChat.tsx Removed local input state management
.changeset/cool-pigs-wink.md Changelog entry for the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zenoachtig zenoachtig merged commit f478ddc into main Dec 16, 2025
16 checks passed
@zenoachtig zenoachtig deleted the input-component branch December 16, 2025 18:43
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.

3 participants