Skip to content

fix(add-data): reposition sample-data dropdown and raise Cancel button contrast (#863)#864

Merged
giswqs merged 2 commits into
mainfrom
fix/issue-863-add-data-sample-data-position-cancel-contrast
Jun 25, 2026
Merged

fix(add-data): reposition sample-data dropdown and raise Cancel button contrast (#863)#864
giswqs merged 2 commits into
mainfrom
fix/issue-863-add-data-sample-data-position-cancel-contrast

Conversation

@giswqs

@giswqs giswqs commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

Addresses the two UX refinements reported in #863 for the Add WFS Layer dialog. Because the same layout pattern is shared across every Add Data source dialog, both fixes are applied consistently to all nine source dialogs (WFS, WMS, WMTS, XYZ, ArcGIS, GeoRSS, GPX, Delimited Text, Video).

1. Reposition the "Sample data" selection

The "Sample data" dropdown previously sat near the top of the form, above "Saved services" and ahead of the primary configuration fields. Loading sample data is a secondary, low-frequency onboarding action, so it has been moved to the very bottom of the form inputs, directly below the last field and right before the action buttons. Standard users can now fill out their production service details top to bottom without navigating past the sample options.

2. Raise the Cancel button contrast

The Cancel button in the shared Add Data footer used the ghost variant (plain text, no boundary), which made it hard to recognize as an interactive element next to the prominent "Add layer" button. It now uses the outline variant, giving it a subtle border, a background, and a neutral hover state so it clearly reads as a clickable action while keeping primary focus on "Add layer".

Verification

Verified in the real app with Playwright against a running dev build:

  • Add WFS Layer dialog in both light and dark themes: "Sample data" now appears at the bottom directly above the buttons, and the Cancel button shows a clear outline border.
  • Add WMS Layer dialog: confirmed the same repositioning carried over to a second source dialog.
  • npm run build and scoped pre-commit (eslint + npm build) pass.

Fixes #863

Summary by CodeRabbit

  • New Features
    • Updated the add-data workflow layout so the sample data pickers appear later in the form across multiple source types, providing a more consistent experience.
  • Bug Fixes
    • Improved the “Cancel” button styling in the add-data footer by switching it to an outlined secondary style for clearer emphasis.
  • UI Polish
    • Added a subtle divider above the sample-picker area to better separate it from the preceding fields.

…n contrast (#863)

Two UX refinements to the Add Data source dialogs reported for the Add WFS
Layer dialog, applied consistently across all nine source dialogs:

- Move the "Sample data" dropdown from the top of the form to the bottom,
  directly below the last input field and right before the action buttons,
  so the primary workflow of entering production service details is no
  longer interrupted by a secondary onboarding action.
- Switch the Cancel button in the shared Add Data footer from the ghost
  variant to the outline variant, giving it a visible border and a neutral
  hover background so it reads clearly as a clickable action next to the
  primary "Add layer" button.

Fixes #863
@netlify

netlify Bot commented Jun 25, 2026

Copy link
Copy Markdown

Deploy Preview for geolibre-app ready!

Name Link
🔨 Latest commit bab6e6d
🔍 Latest deploy log https://app.netlify.com/projects/geolibre-app/deploys/6a3d1ca903797b0008502e43
😎 Deploy Preview https://deploy-preview-864--geolibre-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a6dbaa9c-82a5-470e-a797-7c5fe34ac40d

📥 Commits

Reviewing files that changed from the base of the PR and between ef79f28 and bab6e6d.

📒 Files selected for processing (1)
  • apps/geolibre-desktop/src/components/layout/add-data/shared.tsx

📝 Walkthrough

Walkthrough

Sample data selectors were moved lower in each add-data source form while keeping their options and handlers unchanged. The shared add-data footer cancel button now uses the outline variant.

Changes

Add-data form layout

Layer / File(s) Summary
Sample-data picker placement
apps/geolibre-desktop/src/components/layout/add-data/sources/ArcGISSource.tsx, apps/geolibre-desktop/src/components/layout/add-data/sources/DelimitedTextSource.tsx, apps/geolibre-desktop/src/components/layout/add-data/sources/GeoRssSource.tsx, apps/geolibre-desktop/src/components/layout/add-data/sources/GpxSource.tsx, apps/geolibre-desktop/src/components/layout/add-data/sources/VideoSource.tsx, apps/geolibre-desktop/src/components/layout/add-data/sources/WfsSource.tsx, apps/geolibre-desktop/src/components/layout/add-data/sources/WmsSource.tsx, apps/geolibre-desktop/src/components/layout/add-data/sources/WmtsSource.tsx, apps/geolibre-desktop/src/components/layout/add-data/sources/XyzSource.tsx
SampleDataSelect is moved later in each source form while keeping the same sample values and onSelect behavior.
Cancel button variant
apps/geolibre-desktop/src/components/layout/add-data/shared.tsx
AddDataFooter changes the Cancel button from the ghost variant to the outline variant.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

I hopped through the form with a tidy little grin,
Moved sample seeds lower where the fields begin.
The Cancel button grew an outline bright and neat,
Now this bunny’s add-data hop feels extra sweet.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main UX changes to the add-data dialogs.
Linked Issues check ✅ Passed The WFS sample-data block is moved below the inputs and the shared Cancel button is outlined as requested.
Out of Scope Changes check ✅ Passed The edits stay within the add-data UX scope, including the shared footer and sample-picker components.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-863-add-data-sample-data-position-cancel-contrast

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed due to a network error.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

⚡ Cloudflare Pages preview

Item Value
Preview https://db457a6f.geolibre-preview.pages.dev
Demo app https://db457a6f.geolibre-preview.pages.dev/demo/
Commit c131b6f

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Scope: shared.tsx (Cancel button) + 9 source dialogs (ArcGIS, DelimitedText, GeoRSS, GPX, Video, WFS, WMS, WMTS, XYZ) — repositioning SampleDataSelect from top to bottom of each form.

Bugs

  • None found. The block moves are mechanically identical to the originals; no logic was changed.

Security

  • No issues. The type="password" autoComplete="off" attributes on the ArcGIS access-token field are untouched. The intentional token-clearing in applyFields (see quality note below) remains correct security behaviour.

Performance

  • No issues. These are pure JSX ordering changes with no effect on render cost.

Quality

  • Cancel button (shared.tsx): ghostoutline is a clean, targeted change. ✓
  • Coverage completeness: All 9 files that import SampleDataSelect were updated consistently. The four other source files (MbtilesSource, DeckVizSource, PostgresSource, PhotosSource) don't use the component, so they were correctly left alone. ✓
  • ArcGIS access-token adjacency (low confidence, inline comment): SampleDataSelect now sits directly below the type="password" access-token field. Selecting any sample calls applyFields, which explicitly clears the token (setArcgisAccessToken("")). This is intentional and documented in the source, but the new placement makes accidental triggering more likely. Details in the inline comment.
  • GeoRSS / GPX mode flip: In "file" mode the sample dropdown is now visible at the bottom; selecting it silently switches back to "url" mode. No regression — the mode switch was always there — but the mode picker and the sample dropdown are now at opposite ends of the form, which could occasionally surprise users. Not a bug.

CLAUDE.md

  • No new user-facing strings introduced (no i18n catalog changes needed). ✓
  • No direct MapLibre mutations. ✓
  • Branch pattern is correct (PR against main, no direct main commit). ✓

Overall this is a clean, low-risk UX polish PR. The one inline note is a minor discoverability concern, not a blocking issue.

Set the shared SampleDataSelect apart from the production fields above it
with a faint top border, addressing review feedback that the picker now
sits directly below the ArcGIS access-token field where an accidental
selection would silently overwrite the typed token.
if (samples.length === 0) return null;
return (
<div className="space-y-1.5">
<div className="space-y-1.5 border-t border-border/60 pt-3">

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.

The border-t divider is now baked into SampleDataSelect itself rather than applied at the call site. The updated docstring documents the "bottom of the form" assumption, which is correct for every current usage. Just worth flagging that if any future caller places this component at the very top of a form (before any other fields), the top border will render against empty space and look odd. Since the docstring already captures the constraint, this is low risk — but it's an implicit API contract that could trip up a future developer. One option would be an optional withDivider prop defaulting to true to make the assumption explicit; the current approach is fine if the "bottom only" convention holds.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Reviewed the diff across all 9 changed source files plus the full text of shared.tsx, WmsSource.tsx, WfsSource.tsx, ArcGISSource.tsx, GpxSource.tsx, DelimitedTextSource.tsx, WmtsSource.tsx, XyzSource.tsx, GeoRssSource.tsx, and VideoSource.tsx.

Bugs

None found. All nine dialogs were updated consistently. The state-management handlers (mode switches, column resets, token clearing) are unchanged and remain correct in their new positions.

Security

None found. The ArcGIS dialog's applyFields already calls setArcgisAccessToken("") when a sample or saved-service entry is applied, so the access token is correctly cleared before potentially sending credentials to a different endpoint. The updated JSDoc in shared.tsx now explicitly documents this behaviour, which is a nice safety callout.

Performance

None found. The change is purely positional JSX — no new state, no new effects, no additional renders.

Quality

Medium confidence — border-t baked into the component: The top-divider styling (border-t border-border/60 pt-3) is now part of SampleDataSelect's own render output rather than supplied by each call site. The updated docstring documents the "sits at the bottom" contract, which is satisfied by every current usage. The risk is that a future source which has no form fields above the sample picker would render a floating divider against empty space. See inline comment for one possible mitigation.

Low confidence — inline checkbox immediately above divider: In WmsSource (transparent checkbox) and XyzSource (short-URL checkbox), the element directly above SampleDataSelect is an inline <label> rather than a <div className="space-y-1.5"> block. The space-y-3 container still adds correct spacing, and the border-t pt-3 creates a clear visual break, so this is unlikely to look wrong in practice. Mentioning it only for awareness.

CLAUDE.md

No violations observed. The change touches only UI layout; no new external tile/map hosts are introduced that would require a CSP update. No user-facing strings were added or removed. The PR description notes that npm run build and a scoped pre-commit run passed.

@giswqs giswqs merged commit b18f6e1 into main Jun 25, 2026
21 checks passed
@giswqs giswqs deleted the fix/issue-863-add-data-sample-data-position-cancel-contrast branch June 25, 2026 12:27
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.

UX Report: Minor Change in Visual Hierarchy of Sample Data and Low Contrast Cancel Button

1 participant