Streamline import: skip modal for non-ambiguous file types - #1006
Conversation
|
I'm not sold on the idea of adding a new Options UI menu item to handle the "Remove coincident vertices" toggle. I am not entirely clear on the different import types here and what they look like. Can you provide some testing files that demonstrate how these are handled currently? If we can import geojson files without a modal, that's great and I think that should be the core fix here, but adding more UI to handle app level constant without a way to test and add compare current branch to this branch is a stretch to include. |
|
geojson.io sample data.zip |
|
My reasoning here is there are bound to be more app-level config settings in the future as this project grows, so a UI for that is going to be necessary one day. If we want to allow users to specify whether the app should remove coincident vertices, that UI must live somewhere. I think it makes sense to remove them as a default, but I can see some users not wanting geojson.io to alter their data (I'm sure that's why this was made optional to begin with) |
|
Updated to remove the global options modal. The remove coincident vertices option remains in state set to false in case we ever want to enable it in the future, but for now all imports will not touch coincident vertices. |
AndrewSepic
left a comment
There was a problem hiding this comment.
LGTM! Thanks for refining this PR.
… dialog - Skip the import modal for file types that don't require user input (everything except csv, xls, coordinate-string). Shapefiles and geojson/kml/etc. now import directly without showing a dialog. - Add persistent "Remove coincident vertices" setting via a new Options dialog (gear icon in toolbar), backed by atomWithStorage so it survives page reloads. - Extract useImportFiles hook so drag-and-drop and the Import button share identical classification + auto-import + fitBounds logic. - fitBounds now works correctly after drag-and-drop import. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
b48a39b to
bb59316
Compare
Summary
This PR streamlines imports, removing the need for the modal for most import types. For most imports, the modal was only necessary for toggling the "Remove coincident vertices" setting. The ability for the user to set this has been removed from the UI for now, but the state handlers for it remain in place if we ever want to re-introduce it.
csv,xls, andcoordinate-stringwhere column mapping or coordinate order is ambiguous.useImportFileshook so drag-and-drop (drop.tsx) and the file picker (use_open_files.ts) share identical classification, auto-import, andfitBoundslogic.fitBoundson drag-and-drop — map now flies to imported data extent after dropping a file.Test plan
🤖 Generated with Claude Code