Repository navigation
feat(ui): name tree-added datasets in Recent after their connection - #724
Conversation
A dataset added from the Connections tree is noted in Recent under the connection's name, keeping the source's kind, address and extra. Direct, selected and delayed (service tilesets, WCS, downloads, STAC signing) adds are covered; failed or dropped adds are not renamed.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Code reviewI read the diff and the surrounding call sites. I found no blocking problems. I could not run the tests or CI here, so none of this was run. Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base 6f89228 to PR head 6783571)
|
📖 Docs previewCommit |
| if let Some(origin) = &origin { | ||
| o.insert(connectiontree::ORIGIN.into(), json!(origin)); | ||
| } | ||
| } |
There was a problem hiding this comment.
Nit (low confidence, readability): ORIGIN is removed and then re-inserted. This is needed only because a caller could pass a stray _origin key in p. A short comment saying so, or a single match/insert or remove, would make that intent clearer. The same q[ORIGIN] = … pattern below doesn't strip a pre-existing key first, so the two paths are inconsistent. A user-supplied _origin in ui.addUrl params would also be taken by take_origin_key and used as the Recent name. That is harmless, but the key is effectively part of the command's parameter surface.
Code reviewThe PR names a dataset added from a Connections-tree connection in Recent after that connection, and leaves the entry's kind, address and options as they were. I found no correctness or security bugs. I read the diff only and did not build or run the tests. Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base 6f89228 to PR head 6783571).
|
Recent naming from #699 (comment) (part of #699; this PR does not close it).
A dataset added from the Connections tree is now noted in Recent under the originating connection's name instead of a name derived from the address.
What changes
extrathe add produced (already cleaned/redacted bysources::clean), and the layer keeps its own name. Nothing is replaced with the connection endpoint.ServiceStep,ui.addUrl's probe/download records, the STAC token queue) and apply it only after the add succeeds. The_originkey is internal: it is rebuilt from a fixed key list, so a caller can't forge it, and it never reaches a command.Verification (exercised)
cargo xtask ci(fmt, clippy-D warnings, workspace tests, layers): exit 0, on the base this PR is rebased onto.cargo build --target wasm32-unknown-unknown -p rustgis-webwith a wasm-capable clang (Homebrew LLVM): exit 0.connectiontree.rs: shared-entry dedup and re-add taking the current name; redaction unchanged; failed add leaves Recent untouched; Add Selected naming per connection; delayed local download (success named, 404 not recorded, even after a rename); OGC API tileset step (refused template adds nothing); a WCS coverage through a local server; and the whole path through the pane (open connection, double-click, Recent, click the Recent entry).Limitations and overlaps
sourcespane::open(not in this PR's scope) reopens aserviceRecent entry from its address and type only and ignoresextra.layer, so clicking it opens the service's layer list rather than selecting the stored layer. The entry does keep its kind, address and extra;data.mdstates this honestly. Fixing it needs a change insourcespane.rs.tests/smoke.rs(one line, outside the listed paths, edit approved by the maintainer):connections_tree_browses_and_addsmatched two "Local" nodes once Recent shows that name; it now picks the connection's own row (last match; Recent renders above Connections).Summary by CodeRabbit