Files
CWallyMan 757ad32d80 Web viewport: select multiple items with Apple Pencil taps (#15756)
* Add touchscreen orbit, pan and pinch navigation

Adapt the touch-navigation portion of PR #2412 to current main, preserving
tap selection and isolating gestures from tools and overlay controls. Add
a Navigation preference to retain the previous mouse-mapped behavior.
Exercise the shared navigation handler and real viewport input path.

Original touch work: 64d3d36a87
and d7a0a35e43.

Co-authored-by: Bruno Rocha <brunocrazy.15@gmail.com>
Co-authored-by: brunocrazy15-art <brunocrazy15-art@users.noreply.github.com>

* Keep touchscreen additions compatible with mouse navigation updates

* Keep touchscreen code separate from wheel helper insertions

* Separate touchscreen state from shortcut field insertions

* Preserve touch input bounds around framed render cameras

* Pass the input rect to navigation::handle in touchscreen tests, matching its new camera-rect derivation

* fix: respect reverse zoom for touch pinch

* Use shared geometry for touchscreen navigation

Co-Authored-By: Codex <noreply@openai.com>

* Fix touch navigation lint findings

Co-Authored-By: Codex <noreply@openai.com>

* Qualify SolidCore 2D point helper to avoid import conflict

Co-Authored-By: Codex <noreply@openai.com>

* Web: let pen taps toggle viewport selection

Port the pen selection behavior from the SolidCraft for iPad prototype. Keep it off by default and reuse the viewport's existing picking and selection.

* Control protocol: list pen_tap_toggles_selection in name order

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JfbFpeoRq8n7KiN6ehztrF

* Web: Pencil mode, where a pen selects and fingers move the view

Pen taps toggle items as before; a pen double-tap now also selects the
whole body, or the whole sketch, of the item under it. A finger that goes
down in the open view no longer clicks there: the press the browser makes
for it is dropped and the touch is left for navigation. Fingers on panels,
windows and buttons still click. A finger double-tap on a flat face selects
it and starts a sketch on it. One preference, off by default, renamed from
Pen taps toggle selection to Pencil mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JfbFpeoRq8n7KiN6ehztrF

* Pencil mode: tell an Apple Pencil from a finger, and let fingers navigate

Two faults seen on an iPad:

- Safari sends touch events for an Apple Pencil as well as pen pointer
  events, and eframe hands them on as egui touches. Pencil mode took the
  Pencil for a finger: its presses were dropped, so pen taps selected
  nothing, and two quick Pencil taps started a sketch as a finger
  double-tap does. The web app now names stylus touches (touchType
  stylus, or a touch that starts while a pen tip is down); they never hold
  presses back or count as finger taps, and leave the frame so touchscreen
  navigation does not orbit with the Pencil.
- A finger's press is where egui learns the finger is (eframe sends no
  move before it). Dropping it left the view with no pointer over it, so
  touchscreen navigation never took a finger's orbit, pan or pinch. The
  press now becomes a move to the same place: the view knows the finger is
  there and nothing is clicked.

Regression tests replay the events Safari and eframe send; both failed
before these changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JfbFpeoRq8n7KiN6ehztrF

* Pencil mode: an Apple Pencil tap in Safari is one pen click

An iPad's event log showed three faults with an Apple Pencil in Safari:

- Safari reports the lift twice, as pointerup and touchend, about three
  points apart, and the frame's last release is the touch's. A pen lift
  matched only within 1 point, so Pencil taps were ordinary clicks. It now
  matches within 12 points (PEN_RELEASE_SLOP).
- eframe makes a press and a release of both the pen's pointer events and
  its touch events, so egui counted every Pencil tap as a double-click. In
  Pencil mode the press, release and pointer-gone made of a pen's touches
  now leave the frame with the touches themselves.
- The touch's pointer-gone cleared the hover before the click was read;
  a pen tap now picks where it lifted when nothing is hovered.

The tests replay Safari's sequence from the log, offsets included; the
first and second faults failed them before these changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JfbFpeoRq8n7KiN6ehztrF

* Default touch navigation to off

* Enable touch navigation in gesture tests

* Format Pencil mode changes

* Avoid misidentifying pointer button as UI control

* Fix Pencil and touch gesture review findings

* Fix touch transition and SolidCore lint

---------

Co-authored-by: Roman Lisunov <106732723+RomanLis91@users.noreply.github.com>
Co-authored-by: Bruno Rocha <brunocrazy.15@gmail.com>
Co-authored-by: brunocrazy15-art <brunocrazy15-art@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-11-17 13:01:35 +00:00

50 lines
2.1 KiB
TOML

[package]
name = "solidcraft-web"
description = "SolidCraft in the browser (eframe web runner, WebGPU with WebGL2 fallback)"
version.workspace = true
edition.workspace = true
license.workspace = true
publish = false
[lints]
workspace = true
[[bin]]
name = "solidcraft-web"
path = "src/main.rs"
[features]
default = ["profile"]
bundled-render-library = ["solidcraft-engine/bundled-render-library"]
# The profiler, compiled in so any build can say where its time goes (the Profile operations
# preference, SOLIDCRAFT_PROFILE=1, diagnostics.profile); it records nothing until asked.
profile = ["solidcraft-engine/profile"]
[dependencies]
solidcraft-engine = { workspace = true }
solidcraft-control = { workspace = true }
solidcraft-ui-egui = { workspace = true }
# SolidCraft's look (icons, glyphs, built-in themes), installed at startup.
solidcraft-look = { workspace = true }
solidcraft-ui-text = { workspace = true }
egui = { workspace = true }
log = { workspace = true }
serde_json = { workspace = true }
url = "2"
percent-encoding = "2"
[target.'cfg(target_arch = "wasm32")'.dependencies]
eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] }
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
js-sys = "0.3"
web-sys = { version = "0.3", features = [
"Window", "Document", "Element", "HtmlElement", "HtmlCanvasElement", "Location", "Navigator", "StorageManager",
"FileSystemHandle", "FileSystemDirectoryHandle", "FileSystemFileHandle", "FileSystemGetFileOptions", "FileSystemGetDirectoryOptions", "FileSystemWritableFileStream",
"WritableStream", "File", "FileList", "Blob", "BlobPropertyBag", "Url", "HtmlAnchorElement", "HtmlInputElement", "Storage", "StorageEvent",
"IdbFactory", "IdbDatabase", "IdbObjectStore", "IdbOpenDbRequest", "IdbRequest", "IdbTransaction", "IdbTransactionMode",
"Headers", "ReadableStream", "ReadableStreamDefaultReader",
"BeforeUnloadEvent", "Event", "EventTarget", "KeyboardEvent", "Response", "FormData", "RequestInit", "MediaQueryList", "Gamepad", "Performance",
"PointerEvent", "Node", "VisibilityState", "Touch", "TouchEvent", "TouchList",
] }