Skip to content

Streamline import: skip modal for non-ambiguous file types - #1006

Merged
AndrewSepic merged 3 commits into
mainfrom
cw/streamline-import
Jun 25, 2026
Merged

Streamline import: skip modal for non-ambiguous file types#1006
AndrewSepic merged 3 commits into
mainfrom
cw/streamline-import

Conversation

@chriswhong

@chriswhong chriswhong commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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.

  • Skip the import modal for file types that don't need user input (geojson, kml, topojson, shapefiles, etc.). The modal now only appears for csv, xls, and coordinate-string where column mapping or coordinate order is ambiguous.
  • Extract useImportFiles hook so drag-and-drop (drop.tsx) and the file picker (use_open_files.ts) share identical classification, auto-import, and fitBounds logic.
  • Fix fitBounds on drag-and-drop — map now flies to imported data extent after dropping a file.

Test plan

  • Drop a GeoJSON file — modal should NOT appear, data imports and map flies to extent
  • Drop a shapefile — same, no modal
  • Drop a CSV — import modal should appear with column options
  • Use Import button → same behavior as drag-and-drop for each file type
  • Toggle "Remove coincident vertices" in Options → setting persists after page reload
  • Verify the setting is applied during import (both drag-and-drop and modal paths)

🤖 Generated with Claude Code

@chriswhong
chriswhong requested a review from a team as a code owner June 11, 2026 14:04
@AndrewSepic

Copy link
Copy Markdown
Contributor

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.

@chriswhong

Copy link
Copy Markdown
Contributor Author

geojson.io sample data.zip
This is a local collection of test files, including CSV, OSM, SHP, KML, KMZ, GPX, encoded polyline, etc.

@chriswhong

Copy link
Copy Markdown
Contributor Author

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)

@chriswhong chriswhong changed the title Streamline import: skip modal for non-ambiguous file types, add Options dialog Streamline import: skip modal for non-ambiguous file types Jun 24, 2026
@chriswhong

Copy link
Copy Markdown
Contributor Author

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
AndrewSepic previously approved these changes Jun 25, 2026

@AndrewSepic AndrewSepic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for refining this PR.

chriswhong and others added 3 commits June 25, 2026 15:00
… 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>
@chriswhong
chriswhong force-pushed the cw/streamline-import branch from b48a39b to bb59316 Compare June 25, 2026 19:03

@AndrewSepic AndrewSepic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@AndrewSepic
AndrewSepic merged commit 6959b7b into main Jun 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants