8000 feat(web): SchemaForm, a form generated from a JSON Schema with a variable picker by adeelahmad · Pull Request #566 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(web): SchemaForm, a form generated from a JSON Schema with a variable picker - #566

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-li6m25
Oct 18, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-li6m25

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: nothing in the web app could draw a form from a JSON Schema, so the studio had no way to show an automation action's settings.

After: SchemaForm (components/forms/schema-form.tsx) draws a form from a JSON Schema object, such as an action's params from GET /api/v1/automations/actions. Each property gets the control its type needs: one-line text, a template box (prompts and long text), number, choice (enum, with its default named), toggle, list (one item a line) and JSON object. Labels come from title and hints from description. A field that takes a template accepts {{ }} for any type, as the backend's check_params does. Typing {{ opens a variable picker when variables are passed in (arrow keys move, Enter, Tab or a click puts the variable in, Esc closes). A preview line can go under each field, and the API's problems show next to their fields.

Nothing uses it yet. The next studio PRs (the canvas's action node and the builder's action cards, M11) render with it.

Motivation and Context

Workflow studio M11 (Studio UI), Build step 2: "one reusable SchemaForm component: text, number, choice, toggle, list, and template fields". The canvas (step 6) uses it too. The pure part (schema-model.ts: field kinds, reading typed text as a value, problems, where a {{ is being typed) is kept apart so the builder's own tests can use it.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests (__tests__/schema-form.test.tsx, 9 tests).
  • My change requires documentation updates: n/a, a component with no page yet; the studio walkthrough in docs/automations.md comes with the builder.
  • CHANGELOG: n/a, the title says it.

Local CI (ci/local-ci.sh HEAD --jobs frontend,pre-commit,title): Next.js pass, pre-commit pass, PR title pass.

Done questions (AGENTS.md)

  • Goal: one part of M11; merged on green.
  • Agents: n/a for a form; agents already read and set the same params through the API and MCP.
  • Zero setup: nothing new to install or set.
  • Fewest clicks and keystrokes: defaults show as placeholders and apply when left empty; variables go in from the keyboard.
  • Configurable: n/a, no new settings.
  • Light: a small component, no new dependency.
  • Private and secure: n/a, no new surface; values go to the same API.
  • Cost: n/a, no model calls.
  • User decides: n/a, nothing runs.
  • Upgrades: n/a, no stored data.
  • Honest: n/a, nothing claimed; README lines come with the builder.
  • Tests added; no docs or generated files change.
  • Open standards: JSON Schema; no new dependencies.
  • Reported in the project thread.
  • Reuse: the existing Field, Input, Textarea, Select and Checkbox controls. A JSON Schema form library (react-jsonschema-form) would add a large dependency for seven field kinds.

Generated by Claude Code

…}} variable picker

The studio's action cards and the canvas's action node settings render an
action's params from the actions catalog's JSON Schema: text, template,
number, choice, toggle, list and JSON fields, labels and hints from the
schema, a variable picker on {{ and a preview line per field.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb
@adeelahmad adeelahmad self-assigned this Oct 18, 2026
@adeelahmad
adeelahmad merged commit 6e6443c into main Oct 18, 2026
10 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-li6m25 branch October 18, 2026 07:29
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.

2 participants

0