Overlay: add shared viewport-aware positioning core #8

Closed
opened 2026-06-23 19:00:29 +00:00 by mik-tf · 1 comment
Owner

Parent tracker: #1

Objective: create the shared positioning foundation used by Tooltip and Popover without introducing Bootstrap JavaScript or Popper runtime dependency.

Scope:

  • Add pure positioning types/functions for trigger rect, overlay rect, viewport/boundary rect, requested placement, fallback placements, offset, and effective placement.
  • Support top, bottom, start, end, auto, ordered fallback placements, and viewport/container boundary fitting.
  • Return coordinates and effective placement so Bootstrap arrow/orientation classes match the final placement.
  • Keep logic unit-testable without browser/Dioxus runtime.

Acceptance criteria:

  • Unit tests cover requested placement, fallback placement, viewport edge behavior, offset, and boundary constraints.
  • No component API behavior changes are required in this issue.
  • Public types are named consistently with the parity spec.
  • Existing Rust and migration checks stay green.

Dependencies: parity spec issue.

Signed-by: mik-tf mik-tf@noreply.invalid

Parent tracker: https://forge.ourworld.tf/lhumina_code/dioxus-bootstrap-css/issues/1 Objective: create the shared positioning foundation used by Tooltip and Popover without introducing Bootstrap JavaScript or Popper runtime dependency. Scope: - Add pure positioning types/functions for trigger rect, overlay rect, viewport/boundary rect, requested placement, fallback placements, offset, and effective placement. - Support top, bottom, start, end, auto, ordered fallback placements, and viewport/container boundary fitting. - Return coordinates and effective placement so Bootstrap arrow/orientation classes match the final placement. - Keep logic unit-testable without browser/Dioxus runtime. Acceptance criteria: - Unit tests cover requested placement, fallback placement, viewport edge behavior, offset, and boundary constraints. - No component API behavior changes are required in this issue. - Public types are named consistently with the parity spec. - Existing Rust and migration checks stay green. Dependencies: parity spec issue. Signed-by: mik-tf <mik-tf@noreply.invalid>
Author
Owner

Implemented in dd380ea.

Changes:

  • Added crates/dioxus-bootstrap/src/overlay.rs with pure shared overlay positioning types and logic.
  • Added public OverlayPlacement, OverlayRect, OverlayOffset, OverlayPosition, and calculate_overlay_position.
  • Exported the overlay module through crate module list and prelude.
  • Added unit tests for requested placement, fallback placement, auto placement, offset/skidding, start/end positioning, boundary padding, and oversized overlay clamping.

Validation:

  • cargo fmt --all -- --check passed.
  • cargo test -p dioxus-bootstrap-css passed, including 7 overlay tests.
  • cargo check --target wasm32-unknown-unknown -p dioxus-bootstrap-css passed.
  • cargo clippy --target wasm32-unknown-unknown -p dioxus-bootstrap-css -- -D warnings passed.
  • npm run test:migrate passed.
  • npm run lint:bootstrap passed.
  • Forge Actions run 20 succeeded: MSRV 1.85 and Check/lint/format.

Signed-by: mik-tf mik-tf@noreply.invalid

Implemented in `dd380ea`. Changes: - Added `crates/dioxus-bootstrap/src/overlay.rs` with pure shared overlay positioning types and logic. - Added public `OverlayPlacement`, `OverlayRect`, `OverlayOffset`, `OverlayPosition`, and `calculate_overlay_position`. - Exported the overlay module through crate module list and prelude. - Added unit tests for requested placement, fallback placement, auto placement, offset/skidding, start/end positioning, boundary padding, and oversized overlay clamping. Validation: - `cargo fmt --all -- --check` passed. - `cargo test -p dioxus-bootstrap-css` passed, including 7 overlay tests. - `cargo check --target wasm32-unknown-unknown -p dioxus-bootstrap-css` passed. - `cargo clippy --target wasm32-unknown-unknown -p dioxus-bootstrap-css -- -D warnings` passed. - `npm run test:migrate` passed. - `npm run lint:bootstrap` passed. - Forge Actions run 20 succeeded: MSRV 1.85 and Check/lint/format. Signed-by: mik-tf <mik-tf@noreply.invalid>
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/dioxus-bootstrap-css#8
No description provided.