Files
Qiusheng Wu ed2261b50a fix(3d-tiles): name the layer after the picked sample tileset (#3260)
* fix(3d-tiles): name the layer after the picked sample tileset

Picking a sample in Add Data > 3D Tiles layer only filled the Tileset URL
(and altitude); the Layer name kept whatever an earlier pick had set, so
switching from the Google sample to 3D BAG added the BAG tileset as
"Google Photorealistic 3D Tiles". The sample click now replaces a blank,
default or sample-filled name with the picked sample's label and keeps a
name the user typed. Every pick also reruns the URL defaults, so leaving
the Google sample drops its masked API-key header.

Fixes #3258

* fix(3d-tiles): track the sample-filled name and keep a typed Google key

Address review feedback on the sample-pick fix:
- Remember the name each sample pick (or the Google defaults pass) filled
  in and only replace that one, so a typed name that happens to equal a
  sample label is kept.
- When switching away from the Google sample, keep a typed API key in
  panel memory (still stripped from the field and from non-Google
  requests) so returning to Google does not need it re-entered.
- Add an e2e spec covering sample switching, the typed name, and the
  key round trip.

* fix(3d-tiles): only remember a layer name a sample pick filled in

Storing the field value after every pick also stored a typed name that
the pick kept, so the following pick treated it as sample-filled and
replaced it. Record the name only when the pick changed it, and extend
the e2e spec with a second pick after typing a name.

* fix(3d-tiles): forget the sample-filled name once the user edits it

A user who typed a sample label back into Layer name could still have it
replaced by the next pick, because the remembered name matched. Clear
the memory on any edit to the field, and clarify a unit test comment.
2026-10-27 14:15:58 -04:00
..