Skip to content

feat: expand floating parameters#29

Open
rauhryan wants to merge 2 commits into
mainfrom
rr/upstream-enhancements-main
Open

feat: expand floating parameters#29
rauhryan wants to merge 2 commits into
mainfrom
rr/upstream-enhancements-main

Conversation

@rauhryan
Copy link
Copy Markdown
Collaborator

@rauhryan rauhryan commented May 9, 2026

Motivation

Clay exposes more floating-element controls than clayterm previously made available through the TypeScript directive API. Higher-level UI code needs those controls for popovers, tooltips, modals, and attached floating surfaces without reaching through to renderer internals.

Approach

Expands the open(..., { floating }) surface to cover the currently needed Clay floating options:

  • expand.{ width, height }
  • structured attachPoints.{ element, parent }
  • pointerCaptureMode
  • clipTo
  • zIndex

The public TypeScript API uses string literal values for enum-like options, while ops.ts privately maps those strings to Clay's numeric transfer representation during packing.

The root renderer spec documents the complete current floating shape, and tests cover packing/rendering plus validation of the new fields.

Alternate Designs

Considered exporting numeric constants that mirror Clay's C enums. That was rejected because it leaks implementation details into the public TypeScript surface. String literals better match the existing clayterm API style.

Possible Drawbacks or Risks

floating.parent remains a numeric parent id in this PR. Converting that to an element-id string would require an additional design pass around hashing and transfer encoding, so this PR keeps the scope focused on the enum-like floating controls.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 9, 2026

Open in StackBlitz

npm i https://pkg.pr.new/clayterm@29

commit: ea34f5b

Comment thread specs/renderer-spec.md Outdated
Comment thread test/term.test.ts Outdated
@cowboyd
Copy link
Copy Markdown
Member

cowboyd commented May 9, 2026

For some reason it looks like your agent isn't picking up the organization's PR template. Have a look at this one for an example.

#17

rauhryan added a commit that referenced this pull request May 10, 2026
Comment thread specs/renderer-spec.md
target, z-index)
- **`scroll`** — scroll container configuration

The current floating surface is:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove current. The spec addresses what is.

Copy link
Copy Markdown
Member

@cowboyd cowboyd left a comment

Choose a reason for hiding this comment

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

Approved. Can you remove the references to current in the comment?

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