Skip to content

[UX][P2] Audit input and textarea sizing by tool intent instead of using one flat default #325

Description

@baixiangcpp

User signal

A product walkthrough reported that some input boxes feel too flat/thin and should adapt to the actual tool.

Original feedback: 有些输入框 太扁了,要根据实际工具决定。

Current pattern observed

There is a shared Input component with a global height rule: h-11 ... lg:h-9. There is also a shared Textarea with field-sizing-content min-h-16. Individual tool pages override these ad hoc, for example QR Code Generator uses a short h-24 textarea for QR content and h-9 color hex inputs.

Relevant files:

  • src/components/ui/input.tsx
  • src/components/ui/textarea.tsx
  • src/features/tools/qr-code-generator/page.tsx
  • scripts/scaffolding/create-tool.js
  • representative tools under src/features/tools/*/page.tsx

UX problem

One global input height does not fit every tool:

  • URL, color, number, enum, and short scalar inputs can be compact.
  • Code/data payloads need taller editors or textareas.
  • QR/barcode content, regex samples, CSV/JSON, Markdown/HTML, logs, and JWT-like values need different affordances.
  • Mobile users need larger tap targets and enough vertical space when the software keyboard is open.

Recommended implementation

Define a small sizing taxonomy and make it available through components or tool shell helpers:

  • scalar: compact single-line inputs such as color hex, margin, size.
  • shortText: URL/text fields that should be comfortable but not editor-sized.
  • payload: JSON/CSV/YAML/log/code input with a larger min height.
  • workbench: dense split-pane/editor tools.
  • generatedOutput: read-only output area with copy/export actions.

Then audit representative tools and remove one-off height decisions where possible.

Representative routes

  • /en/qr-code-generator
  • /en/base64-encode-decode
  • /en/regex-tester
  • /en/json-formatter
  • /en/csv-json-converter
  • /en/jwt-decoder
  • /en/pipeline-builder

Acceptance criteria

  • Inputs and textareas on representative tools are sized according to expected content, not only by shared defaults.
  • Short scalar controls remain compact; user-authored payload fields are visibly comfortable.
  • Mobile touch target requirements remain satisfied.
  • npm run create:tool scaffolds a sensible default input size or requires choosing an input intent.
  • Add a guard or component test that documents the sizing taxonomy and prevents regressions in the scaffold/template.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions