Skip to content

docs: use raw URLs in the embedding data/style examples - #1803

Merged
giswqs merged 4 commits into
mainfrom
docs/raw-embed-urls
Aug 9, 2026
Merged

docs: use raw URLs in the embedding data/style examples#1803
giswqs merged 4 commits into
mainfrom
docs/raw-embed-urls

Conversation

@giswqs

@giswqs giswqs commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Rewrites the data and style deep-link examples in the embedding guide to use plain, unencoded URLs. : and / are legal in a query value, so the percent-encoded spelling was noise that made the examples hard to read and copy. Encoding is now shown only on the REST endpoint example, which carries its own query string and genuinely needs it, and the trailing guidance names the characters that actually break (&, +, %, #) instead of advising encoding everywhere.
  • Moves the "Open remote data" section below "Embedding in a page" so the page introduces the iframe before the parameters it takes. The #open-remote-data anchor is unchanged, so the inbound links from the layers and styling guides still resolve.
  • Applies the same raw spelling to the two duplicate copies of the example in docs/index.md and docs/user-guide/layers.md, which otherwise disagreed with the embedding guide.
  • Adds an "Open in GeoLibre" badge subsection with copy-paste Markdown, reStructuredText, and HTML snippets, for both the data= and url= deep links. It reuses the shields.io green already used by the badges in docs/getting-started.md. This was added after the PR was opened, so it is a deliberate inclusion rather than a rebase artifact.
  • Adds tests pinning the raw spelling and the nested-= behavior. The suite previously covered only the encodeURIComponent-wrapped form, so nothing guarded the form the docs lead with.

Test plan

  • node --import tsx --test tests/data-url.test.ts passes (19/19), covering the raw form and a nested = that survives unencoded
  • Pre-commit hooks pass on the changed files, including the build
  • Verified against dataUrlParameters that extraction is a plain URLSearchParams.get() with no additional decode step, so raw values round-trip unchanged
  • Verified with a CommonMark renderer that & does not terminate a Markdown link destination, and corrected the badge caveat that claimed otherwise
  • Rendered docs spot-check: section order reads correctly, the badge renders, and the three cross-links to #open-remote-data still land

Summary by CodeRabbit

  • Documentation

    • Updated web app, embedding, and layer examples to use clearer unencoded HTTPS URL formats.
    • Clarified when nested URLs require encoding in query parameters.
    • Added guidance for “Open in GeoLibre” badges in Markdown, reStructuredText, and HTML.
    • Refined instructions for loading remote data, styles, COGs, GeoParquet, and PMTiles.
  • Tests

    • Added coverage confirming raw HTTPS data and style URLs are preserved correctly.

The `data` and `style` deep-link examples were written with every nested
URL percent-encoded, which made them hard to read and copy even though
`:` and `/` need no escaping in a query value. Encoding is now shown only
where it is actually required, on the REST endpoint that carries its own
query string. Also moves "Open remote data" below "Embedding in a page"
so the page introduces the iframe before the data parameters it takes.
Copilot AI lite review requested due to automatic review settings August 9, 2026 17:20

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@giswqs, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e8dc710b-00d2-4184-bf23-2eecfef531d1

📥 Commits

Reviewing files that changed from the base of the PR and between 45637e4 and 9bbdc5b.

📒 Files selected for processing (1)
  • docs/user-guide/embedding.md
📝 Walkthrough

Walkthrough

GeoLibre now tests and documents unencoded HTTPS values for data and style query parameters. The embedding guide also documents nested URL encoding and “Open in GeoLibre” badges.

Changes

URL Parameter Handling

Layer / File(s) Summary
Unencoded URL parsing coverage
tests/data-url.test.ts
Tests verify that raw HTTPS data and style URLs remain complete after parsing, including nested query-string equals signs.
URL examples and embedding guidance
docs/index.md, docs/user-guide/embedding.md, docs/user-guide/layers.md
Examples use direct HTTPS URLs. The embedding guide documents nested URL encoding, retains related style guidance, and adds Markdown, reStructuredText, and HTML badge examples.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit keeps URLs plain,
HTTPS values cross the lane.
Data and styles stay complete,
Nested equals signs take their seat.
Badge links hop to GeoLibre.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main documentation change to use raw URLs in embedding data and style examples.
✨ 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 docs/raw-embed-urls

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 Aug 9, 2026

Copy link
Copy Markdown
Contributor

🔍 Cloudflare PR preview

Item Value
Site https://989db944.geolibre-preview.pages.dev
Demo app https://989db944.geolibre-preview.pages.dev/demo/
Commit 9bbdc5b

Comment thread docs/user-guide/embedding.md Outdated
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Code review

Bugs: None found — this is a docs-only change plus one new test; no runtime logic changed. dataUrlParameters (apps/geolibre-desktop/src/lib/data-url.ts) already does a plain URLSearchParams.get() with no extra decode step, matching the PR's claim.

Security: None found — no user input handling changes.

Performance: N/A — docs and a unit test only.

Quality:

  • docs/user-guide/embedding.md:137 — the guidance lists = among characters that "actually break" GeoLibre's query parsing, but per the application/x-www-form-urlencoded algorithm URLSearchParams implements, only the pair is split on & and then on the first =; any additional = in the value is preserved verbatim. A nested URL like ...?title=Foo doesn't need encoding on that account — only an embedded & does. Confidence: medium (the claim is over-cautious rather than actively wrong, since encoding it anyway is harmless, but it slightly contradicts the PR's own stated goal of showing the minimal necessary encoding). Left an inline suggestion.

CLAUDE.md adherence: Doc changes are consistent with the repo's docs conventions (docs/*.md); the new test lives in tests/data-url.test.ts per the frontend test layout (node --test + tsx), and the PR body documents the exact command used to run it.

Section move (## Open remote data relocated below ## Embedding in a page) was checked against all three cross-linking docs (layers.md, styling.md) — the #open-remote-data anchor is unchanged and every inbound link still resolves. Internal "as above"/"below" references inside embedding.md remain consistent after the reorder.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

🔍 GitHub Pages PR preview

Item Value
Site https://opengeos.org/pages-preview/GeoLibre/pr-1803/
Demo app https://opengeos.org/pages-preview/GeoLibre/pr-1803/demo/
Commit 9bbdc5b

Note

GitHub Pages built this preview successfully, but its serving edge returned HTTP 403 when checked. The links may still be propagating.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/user-guide/embedding.md`:
- Line 137: Update the documentation guidance in the embedding URL section to
remove `=` from the characters requiring nested URL encoding, leaving `&`, `+`,
`%`, and `#`. Preserve the REST example’s encoded form because its nested URL
contains `&`.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d85f0d68-7048-4a9b-8f8f-8159adb24367

📥 Commits

Reviewing files that changed from the base of the PR and between f983f08 and 1852998.

📒 Files selected for processing (4)
  • docs/index.md
  • docs/user-guide/embedding.md
  • docs/user-guide/layers.md
  • tests/data-url.test.ts

Comment thread docs/user-guide/embedding.md Outdated
Publishing a dataset is a common way GeoLibre gets shared, but the docs
gave no ready-made badge for a README or catalog entry. Adds Markdown,
reStructuredText, and HTML snippets for both the data and project deep
links, matching the shields.io style already used elsewhere in the docs.
Comment thread docs/user-guide/embedding.md Outdated
Comment thread docs/user-guide/embedding.md Outdated
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Code review

Bugs

  • None found in the changed lines — this is a docs + test change with no executable app logic modified beyond the new test case, which correctly exercises dataUrlParameters (medium-high confidence).

Security

  • No security concerns; no user input handling, secrets, or injection surfaces are touched.

Performance

  • N/A — docs and a single unit test.

Quality

  • docs/user-guide/embedding.md:137 — the "must encode" character list includes =, but per the WHATWG form-urlencoded parsing algorithm that dataUrlParameters/URLSearchParams relies on, only the first = in each &-delimited pair is significant; a nested = doesn't actually break parsing the way & does. This slightly undercuts the PR's stated goal of naming only the characters that "actually break." Confidence: medium.
  • docs/user-guide/embedding.md:205-210 — the claim that an unencoded & "will also end the link at that character in some renderers" doesn't match CommonMark's link-destination grammar (which terminates on unmatched )/whitespace, not &), and no specific renderer is cited. Worth confirming or softening. Confidence: low-medium.
  • The diff for embedding.md also introduces an entirely new "An 'Open in GeoLibre' badge" subsection (~45 lines) that isn't mentioned anywhere in the PR title, body, or CodeRabbit summary, which otherwise focus solely on the raw-URL rewrite and section reorder. Content-wise the new section looks correct (valid Markdown/reST/HTML badge syntax, valid #url-parameters anchor), but it's worth confirming this is an intentional inclusion (e.g., a companion commit already on the branch) rather than an unintended scope creep / rebase artifact. Confidence: medium.
  • The rest of the changes (raw-URL rewrites in docs/index.md, docs/user-guide/layers.md, docs/user-guide/embedding.md, and the section reorder) are consistent across all three copies, the #open-remote-data anchor is correctly preserved, and the new regression test in tests/data-url.test.ts accurately reflects dataUrlParameters's actual behavior (plain URLSearchParams.get(), no extra decode step).

CLAUDE.md

  • No violations found — this PR doesn't touch i18n-managed UI strings, CSP allowlists, generated catalogs, or other areas CLAUDE.md calls out; it's docs + a frontend test, consistent with repo conventions.

giswqs added 2 commits August 9, 2026 13:33
- Drop `=` from the list of characters that force encoding in a nested
  data/style URL. `URLSearchParams` splits each `&`-delimited pair on its
  first `=` only, so a nested `=` survives verbatim; listing it undercut
  the point that raw URLs need less encoding than commonly assumed.
- Cover that behavior in tests/data-url.test.ts so the documented claim
  is pinned rather than asserted only in prose.
- Correct the badge caveat. It claimed an unencoded `&` ends a Markdown
  link at that character; checked against a CommonMark renderer, the link
  destination survives `&` intact. The real reason to encode is unchanged
  and already stated: GeoLibre reads the `&` as its own separator.

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/user-guide/embedding.md (1)

105-108: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Limit the REST encoding requirement to characters that require it.

This text says that any endpoint with nested query parameters needs percent-encoding. A URL with only ?category=parks contains a bare = and parses correctly without encoding. This conflicts with Line 137 and the new parser test.

Proposed wording
-An endpoint that takes its own query parameters is the case that does need percent-encoding, so its `&` separators are not read as GeoLibre's own:
+If the nested endpoint URL contains `&`, `+`, `%`, or `#`, percent-encode it so the outer URL parser does not alter its value:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/user-guide/embedding.md` around lines 105 - 108, Update the REST API URL
guidance near the `data` parameter example to require percent-encoding only for
characters that conflict with GeoLibre's outer URL parsing, especially nested
`&` separators, rather than for every endpoint query parameter. Clarify that a
nested query containing only a parameter such as `?category=parks` can remain
unencoded, consistent with the parser behavior and tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docs/user-guide/embedding.md`:
- Around line 105-108: Update the REST API URL guidance near the `data`
parameter example to require percent-encoding only for characters that conflict
with GeoLibre's outer URL parsing, especially nested `&` separators, rather than
for every endpoint query parameter. Clarify that a nested query containing only
a parameter such as `?category=parks` can remain unencoded, consistent with the
parser behavior and tests.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c33806c5-85d7-462b-bd58-61b2ad721f22

📥 Commits

Reviewing files that changed from the base of the PR and between 5978ca1 and 45637e4.

📒 Files selected for processing (2)
  • docs/user-guide/embedding.md
  • tests/data-url.test.ts

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

All checks out: the doc's claims match dataUrlParameters' actual URLSearchParams-based parsing (raw :// need no encoding, &/+/%/# do, first-=-only splitting), the new tests correctly pin that behavior, the reordered #open-remote-data anchor and #url-parameters anchor both still resolve, and the badge examples use valid Markdown/RST/HTML link syntax with a shields.io style consistent with docs/getting-started.md. This is a well-verified, low-risk documentation change with no code behavior modified.

No inline comments were warranted — I found no bugs, security issues, performance problems, or CLAUDE.md violations in this diff.

Code review

Bugs: None found. The doc's encoding guidance (:// need no escaping; &, +, %, # do; only the first = per pair separates name/value) was cross-checked against the actual dataUrlParameters/URLSearchParams implementation in apps/geolibre-desktop/src/lib/data-url.ts and matches exactly. High confidence.

Security: None found. No behavior/code changes, only documentation and a new pinned test. High confidence.

Performance: Not applicable — docs-only change plus a small test addition.

Quality: Minor prose nit — the sentence "An endpoint that takes its own query parameters is the case that does need percent-encoding..." (embedding.md:105) reads slightly awkwardly, but it's accurate and not worth blocking on. Low confidence / low severity, not filed inline.

CLAUDE.md: No violations. The change stays within docs/ and tests/, doesn't touch any of the mirrored-constant or generated-catalog files the guidelines call out, and the new test follows the existing node --test pattern in tests/data-url.test.ts.

Also verified: the #open-remote-data and #url-parameters anchors referenced from layers.md and within embedding.md itself still resolve after the section reorder, and the "Open in GeoLibre" badge's shields.io styling matches the existing badges in docs/getting-started.md.

@giswqs
giswqs merged commit 8f05318 into main Aug 9, 2026
23 checks passed
@giswqs
giswqs deleted the docs/raw-embed-urls branch August 9, 2026 17:38
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