Skip to content

fix(core): show drafts, outputs and nodes as plain shapes in hovers - #64

Merged
tinas merged 3 commits into
mainfrom
fix/readable-hover-types
Nov 15, 2026
Merged

tinas merged 3 commits into
mainfrom
fix/readable-hover-types

Conversation

@tinas

@tinas tinas commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

Hovers show drafts, outputs and definitions as plain object shapes at every depth. TypeScript prints a type that an alias builds under the name of that alias, so:

  • Simplify ends with & {}, and nested drafts and outputs no longer print as Simplify<DraftObject<…> & {} & {…}>.
  • GroupDefinitionOf and FieldDefinitionOf are conditional types, so a definition prints as GroupDefinition<…> or FieldDefinition<…> with its values instead of its schema types.
  • A group's children pass through Simplify, so NoInfer and EmptyObject no longer show.

TypeScript 5.9 and 7 print the same text apart from the order of keys.

Testing

  • hover.test.ts asks the TypeScript 5.9 language service for the quick info of a fixture and compares the text. Undoing any one of the three changes fails at least one of its tests. Core installs TypeScript 5.9 as typescript-5, since TypeScript 7 has no JS API.
  • A new test in async-validation.test.ts checks that changes within the pause run a change-triggered check once, for the last value.

Docs

Not covered

A group node lists its input, output and draft before its children, so for a group with nested groups the hover gets long and the children are cut off. The docs keep type queries on fields.

@github-actions

Copy link
Copy Markdown
Contributor

🦋 Changeset detected

Latest commit: 1900553

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

This PR includes changesets to release 3 packages
Name Type
@formtree/core Patch
@formtree/vue Patch
@formtree/react 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

@tinas
tinas merged commit 6e52603 into main Nov 15, 2026
3 checks passed
@tinas
tinas deleted the fix/readable-hover-types branch November 15, 2026 21:11
@github-actions github-actions Bot mentioned this pull request Nov 15, 2026
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.

1 participant