Skip to content

Place positioned popups on whole device pixels - #11461

Open
PepijnSenders wants to merge 2 commits into
Effect-TS:mainfrom
PepijnSenders:ui-kit-round-popup-coordinates
Open

PepijnSenders wants to merge 2 commits into
Effect-TS:mainfrom
PepijnSenders:ui-kit-round-popup-coordinates

Conversation

@PepijnSenders

Copy link
Copy Markdown

trackPosition wrote a positioned popup's left and top as they came out of placement. Next to an anchor at a fractional offset (flex layouts, scaled cards, devicePixelRatio 2), the popup landed on a fractional device pixel and its text and 1px borders were drawn blurred. --anchor-width and --anchor-height were already snapped; left and top were not.

This rounds both to the device pixel ratio, as Floating UI's roundByDPR does (so also Radix, which positions with Floating UI). Found while porting a Radix UI to the kit: tooltips and select popups rendered softer than the originals at DPR 2.

  • ui/kit/Positioning.ts: left and top go through Math.round(value * dpr) / dpr, using the dpr already read for snap.
  • PositioningDocument.test.ts: a popup against an anchor at (300.3, 200.6) lands on whole pixels at DPR 1 and half pixels at DPR 2.
  • A patch changeset.

Checked: the kit's positioning tests, pnpm check in packages/effect, oxlint and dprint check on the changed files.

🤖 Generated with Claude Code

PepijnSenders and others added 2 commits December 3, 2026 12:21
`left` and `top` are rounded to the device pixel ratio, as Floating
UI's `roundByDPR` does, so a popup next to an anchor at a fractional
offset no longer draws its text and borders blurred.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Dec 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4095db9

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

This PR includes changesets to release 43 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/vitest Patch
@effect/ai-amazon-bedrock Patch
@effect/ai-anthropic Patch
@effect/ai-cloudflare Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/ai-typesafe Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/chat-discord Patch
@effect/chat-slack Patch
@effect/chat-teams Patch
@effect/chat-telegram Patch
@effect/chat-whatsapp Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-cloudflare Patch
@effect/platform-deno Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/graphql-generator Patch
@effect/openapi-generator Patch
@effect/ui-devtools Patch
@effect/ui-native Patch
@effect/ui-opentui 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

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 40.55 KB 40.55 KB 0.00 KB (0.00%)
basic.ts 6.80 KB 6.80 KB 0.00 KB (0.00%)
batching.ts 12.03 KB 12.03 KB 0.00 KB (0.00%)
brand.ts 7.03 KB 7.03 KB 0.00 KB (0.00%)
cache.ts 12.30 KB 12.30 KB 0.00 KB (0.00%)
config.ts 24.02 KB 24.02 KB 0.00 KB (0.00%)
differ.ts 22.88 KB 22.88 KB 0.00 KB (0.00%)
http-client.ts 29.03 KB 29.03 KB 0.00 KB (0.00%)
http-router.ts 39.70 KB 39.70 KB 0.00 KB (0.00%)
logger.ts 12.46 KB 12.46 KB 0.00 KB (0.00%)
metric.ts 10.29 KB 10.29 KB 0.00 KB (0.00%)
optic.ts 7.26 KB 7.26 KB 0.00 KB (0.00%)
pubsub.ts 17.02 KB 17.02 KB 0.00 KB (0.00%)
queue.ts 13.83 KB 13.83 KB 0.00 KB (0.00%)
schedule.ts 12.59 KB 12.59 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 14.62 KB 14.62 KB 0.00 KB (0.00%)
schema-binary.ts 43.61 KB 43.61 KB 0.00 KB (0.00%)
schema-class.ts 22.61 KB 22.61 KB 0.00 KB (0.00%)
schema-codegen.ts 33.98 KB 33.98 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 31.06 KB 31.06 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 28.80 KB 28.80 KB 0.00 KB (0.00%)
schema-string-transformation.ts 16.39 KB 16.39 KB 0.00 KB (0.00%)
schema-string.ts 12.89 KB 12.89 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.99 KB 16.99 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 40.12 KB 40.12 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 21.77 KB 21.77 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 21.93 KB 21.93 KB 0.00 KB (0.00%)
schema-toFormatter.ts 22.04 KB 22.04 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 27.05 KB 27.05 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 22.08 KB 22.08 KB 0.00 KB (0.00%)
schema.ts 21.73 KB 21.73 KB 0.00 KB (0.00%)
stm.ts 15.08 KB 15.08 KB 0.00 KB (0.00%)
stream.ts 10.83 KB 10.83 KB 0.00 KB (0.00%)
supervisor.ts 12.27 KB 12.27 KB 0.00 KB (0.00%)

UI Bundle Size

Vite 8.4.0/Rolldown, production, default Oxc minification, es2023, ES modules, gzip level 9 per chunk. effect 4.2.0, Node v26.12.1. Effect-only client: 27528 B gzip (Δ 0 B vs base).

App Chunks Raw bytes Gzip bytes Added gzip B Δ raw bytes Δ gzip bytes
counter 1 176280 60862 33334 0 0
features 1 185934 64361 36833 0 0
menu 1 290751 99077 71549 +30 +4

This branch is waiting to be deployed

1 waiting deployment
fork — 4095db93 Waiting Dec 3, 2026 by PepijnSenders via approval-gate #29461
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