Repository navigation
fix(map): show the Mapbox logo and attribution - #330
Conversation
Mapbox's terms require both to be visible. The wordmark sat in mapbox's own corner, bottom-left, which is where this app puts the drawer: the side panel covers that corner, and the bottom sheet covers the whole bottom edge at every snap point. Measured before this change, at 1280x800 and at 390x844, elementFromPoint over the wordmark's centre returned the drawer, not the wordmark. The attribution control was off outright. The corner now follows the layout: bottom-right beside the panel, top-left under the settings cog on a narrow embed. It moves in CSS rather than through mapbox, because nothing can re-choose it at runtime - logoPosition is read once at construction, LogoControl is not an export to remove and re-add, and react-map-gl reads a control's position once for the same reason. So Map.tsx publishes the inset as --sy-map-attribution on the one element react-map-gl styles, and globals.css places mapbox's container from it. The attribution is rendered as a compact control in that same container, so one inset places both. Which layout is the drawer's own question, so it reads the same signal: the map is DrawerStack's sibling and cannot take WidgetWidthContext, but map mode measures frameElement() in both, so the two cannot disagree. attribution.test.ts holds the three couplings that fail silently: the property name across the two files, one attribution rather than none or two, and the narrow offset clearing the cog, derived from the spacing step and the cog's own classes rather than restated. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NRBKCTunvMm35es6XmtV57
A host sees the wordmark and the attribution button appear on the map, so the guide hosts read needs the entry. docs/embedding.md is unchanged on purpose: the attribution control reaches for no device API, adds no origin and no attribute, and renders inside the widget's own element, so neither its CSP table nor its Permissions Policy table gains a row. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NRBKCTunvMm35es6XmtV57
Trim the three copies of one argument down to the file that owns each: the constant's docblock keeps the library facts, the stylesheet keeps the #262 fallback reason, and the call site keeps one sentence. Drop the `as CSSProperties` cast. The memo's object reaches `style` as a variable rather than a fresh literal, so excess-property checking never applied and the cast only re-indented a comment block the repo protects. Move the comment that sat inside the `<ReactMapGL>` opening element out to the control it describes. `jsx-sort-props --fix` moves props and leaves comments where they sat (#161), so a comment there is a hazard. De-anchor the spec's inset regex from Prettier's indentation, and name which of the three cog reads broke instead of one opaque NaN comparison. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NRBKCTunvMm35es6XmtV57
docs/rules/mapbox.md gains the rule a future map author needs: both controls stay in one corner container, because that is what lets a single inset place them, and the permissions rule's control list is now two rather than one. The new spec takes the last slot under the per-edit selection ceiling: the widest edit, `src/test-support/repo-source.ts`, selects 16 against a ceiling of 16. Measured today, median of three on 4 cores, it still costs 4.5s. Three notes said 15 or "one slot left" and now say otherwise. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NRBKCTunvMm35es6XmtV57
Deploying sahajatlas with
|
| Latest commit: |
b531b3e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://054ce9d9.sahajatlas.pages.dev |
| Branch Preview URL: | https://claude-fix-324-map-attributi.sahajatlas.pages.dev |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sahajatlas-design | b531b3e | Oct 27 2026, 01:43 AM |
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
One conflict, in CHANGELOG.md § Unreleased → Fixed: both sides added a new entry at the head of the section. Both entries are kept, this PR's #324 above main's #329, since this one lands later. main's #329 adds a case to scripts/postcss-scope-widget.test.ts through a readRepoSource call that spec already made, so it takes no further slot in the per-edit selection this branch moved to its ceiling of 16. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012fXJ8cXFDNxJUqYbjzhsTm
|
Merged The one thing worth checking: #329 adds a case to Lean gate green — lint, typecheck, 1762 unit tests. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The fix works. I re-measured it on the built preview, the only place the scoping pass and the minifier are real, and agree with the body's numbers.
It is also the largest shape the ticket's two corners allow: a measured width in Map.tsx, a custom property, a stylesheet that cannot see it, an 85-line spec whose whole job is to pin that pair, and the per-edit ceiling spent to its last slot. The acceptance criterion asks only that both controls be visible and uncovered — two corners are the ticket's Approach, not its requirement. The top-right container is clear in both layouts and already holds GeolocateControl, so one fixed corner needs none of those pieces. Worth settling before this merges.
The rest holds. No origin, no fetch, no device API, so the CSP and Permissions Policy tables genuinely stay put. frameElement() is safe in that render body — MapFrame gates its children on the published node.
Findings
- should-fix — the two-corner design and the five pieces it costs:
Map.tsx:113. - consider — the panel inset is physical, so RTL's deferred drawer flip undoes it silently:
Map.tsx:114.
What was checked
Preview in Chromium: logo and attribution each hit themselves, at (1226,783) and (1198,739) on 1280×800, (50,110) and (22,66) on 390×844, one attribution, top-right column 42×42. Read whole: Map.tsx, globals.css 535–575, responsive.ts, lib/overlay.ts, MapFrame.tsx, DrawerStack.tsx 700–860, Drawer.tsx's direction variants, attribution.test.ts. Grepped every GeolocateControl and control-inventory reference in docs/ and src/, and embedding.md for attribution, wordmark and controls — nothing stale. Confirmed RTL reaches the widget (Widget.tsx:371) and the cog is start-3, so today's RTL narrow case is the accepted nudge one rule above it.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`ATTRIBUTION_INSET.panel` is physical, and the drawer's RTL flip is deferred (`atoms/Drawer`'s `TODO(rtl, #52 WS8)`). When that flip lands the panel moves to the inline start and the credits go back under it, silently — the failure `attribution.test.ts` exists to catch, and the one thing it cannot see. Nothing but prose couples the two, so the drawer's TODO now names this file and the table says why it stays physical. Not written as `inset-block`/`inset-inline`, the other option on that thread: `DrawerStack` picks `direction` as `isWide ? 'left' : 'bottom'`, with no reference to `dir`, so the panel is on the left under RTL today too. Flipping only the credits would move them onto it now, trading a future silent failure for a present one. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PZ67LpFGuTRiFos3YuiYQz
|
Answered the adversarial pass: one adopted, one open. Adopted — the panel inset is physical, in 6f45529. The drawer's Open, and it holds this PR — one corner instead of two. The premise checks out: top-right is clear at both sizes. But #324's Approach names bottom-right and top-left, so the placement is the reviewer's call. Both options are on the thread; keeping the two corners is the recommendation. Base already current with 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
The base merge turned this pin red without either side breaking it alone. #322's `mobile-zoom.test.ts` and #324's `attribution.test.ts` both read a repo file through `readRepoSource`, so each takes a slot in the selection for `src/test-support/repo-source.ts` — 15 before the two, 17 after. Timed the hook rather than dropping a spec, as the pin's own comment says to. On 4 cores, medians of three: 4.2s for the widest edit at 17 specs, 5.0s for `src/config/i18n.ts` at 12 — against a 12-second budget. Both below the figures `docs/testing.md` carried, so the two are recorded as one machine's pair rather than as a trend. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CMsB7e37kLyYojD9ZxTwEe
|
Base merged ( The per-edit selection ceiling tripped on the merge, not on either branch. #322's Open, and it holds this PR — the attribution in the cog menu. Mapbox's terms do not allow the credits off the map: their guide sanctions one collapsed form, Mapbox's own information button, which Lean gate green: lint, typecheck, 1771 tests. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
Your approval landed on Moving the ⓘ down is one line. I did not push it, because of what that corner costs on a phone:
Pick one and the next run builds it:
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
@sydevs-bot Revise
|
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
ee97071 already makes the code change the reviewer asked for on 01:29Z: logoPosition="bottom-right", the ⓘ at top-right. Everything around those two literals still describes one shared corner. That is why CI is red: the spec pins the two as equal.
What's left is subtractive. Drop one spec case, and rewrite four comments or docs that claim the wordmark sits top right. No new mechanism is needed, and none should come back. The measurement stays gone.
Two things live outside the diff. The PR body's Summary, Change outline and Manual verification still say "both top-right", so refresh them. #324's criterion asks for a visible logo at 390×844, which this PR now deliberately misses. Name that accepted exception in the body beside Closes #324. The RTL question thread is half moot: only the ⓘ still shares the cog's RTL corner.
Findings
- blocker — the same-corner pin, the red check:
attribution.test.ts:35. - should-fix — the placement comment contradicts line 439:
Map.tsx:532. - should-fix — the "ONE fixed corner" rule section:
docs/rules/mapbox.md:207. - should-fix — the host-facing entry says top right at every size:
CHANGELOG.md:303. - consider — stale column inventory:
globals.css:558, andDrawer.tsx:80.
What was checked
I read the reviewer's 01:29Z comment, the corner thread (r4383933328), the RTL question thread and #324. I read git diff origin/main...origin/claude/fix-324-map-attribution at ee97071, all 8 files. I grepped every "top right", "one corner" and "same corner" claim on the branch. embedding.md names no corner, so it needs nothing. I opened no preview: the body's links name the withdrawn pages.dev host. Profile read.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The equality case was the red `Lint, Typecheck & Build`: the review split the corners, so the wordmark sits bottom-right and the information button top-right. Each literal is now pinned on its own. The attribution keeps the derivation from `PEEK_SNAP`, since the top right is still the one corner no drawer covers. The wordmark's own case guards the half of #324 that is still a defect — mapbox's default bottom left, which the 352px side panel covers on a wide embed. The narrow sheet covering the bottom right is the accepted exception, so no case asserts it. Each case watched failing against its own defect: the wordmark at bottom-left, at top-right, and with `logoPosition` dropped. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CLL6hhnF1c1Tof2EGLJPim
The comment said the top right held both, which line 439 contradicts. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CLL6hhnF1c1Tof2EGLJPim
The section's title and its one-container rule described the placement the review replaced. The top right is still the only corner no drawer covers, so it keeps the attribution; the wordmark's bottom right is clear of the panel and covered by the sheet's peek, which the review accepted. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CLL6hhnF1c1Tof2EGLJPim
The entry named one corner at every embed size for both. A host reading it would look for the wordmark where it is not, and would not be told the sheet covers it on a phone. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CLL6hhnF1c1Tof2EGLJPim
Two comments listed three controls in mapbox's top-right container. It holds the locate button and the attribution; the wordmark is in the other corner. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CLL6hhnF1c1Tof2EGLJPim
|
Your 01:29Z call is built on Adopted, one commit per thread:
Open, waiting on you: the RTL corner, half moot — only the ⓘ shares the cog's corner now. #324's criteria record the covered phone wordmark as accepted. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
bottom-right, the ⓘ attop-rightbeneath the locate control.useIsWideread, a custom property on the canvas and two CSS rules all go with it.Change outline
Flow — who picks each corner
Nothing in Mapbox can re-choose a corner after the map is built. Corners that never move do not need to.
Mapbox() src/components/organisms/Mapbox/Map.tsx <ReactMapGL> attributionControl={false} # mapbox's own is unpositionable + logoPosition="bottom-right" # read once, in the Map constructor <GeolocateControl …/> # top-right, unchanged + <AttributionControl compact position="top-right" /> # the one corner no drawer covers - useIsWide(frameElement()) # gone — neither corner follows the layout - canvasStyle: '--sy-map-attribution' # goneWhich corner each one takes, and why
Neither control can be dropped: Mapbox requires the wordmark outright, and the text attribution for any map using its styles or data.
Contract — what a host sees
docs/embedding.md § Permissions Policy unchanged — the control reaches for no device API docs/embedding.md § Content-Security-Policy unchanged — no new origin, no new fetch CHANGELOG.md § Fixed rewritten: one corner per credit, and the phone sheet named as still covering the wordmarkTest results
b531b3e: ✓.claude/skills/pr-prep/check.sh— lint, typecheck, 1793 unit tests across 152 files (89s), on the merged base.--full: ✓pnpm buildandpnpm sizeonea2713e, includingassert-css-scoped.mjs(1190 rules confined, 768var()references resolved) andassert-no-sourcemaps.mjs. Not re-run on this push, which changes one spec, four comments and two docs — CI runs build and size.src/styles/is a trigger path) and clean.globals.csscarries no declaration change at all on this branch: strip its comments and it is byte-identical toorigin/main's, so the trigger fired on prose. The one behavioural line,logoPosition, is a static literal matched against mapbox's fixed container set. NocustomAttributionanywhere insrc/, and no<Source>setsattribution, so the control'sinnerHTMLsink takes only mapbox's own credits through itssanitizeLinks.bottom-left, attop-right, and withlogoPositiondropped; the ⓘ moved off the top right;compactdropped; mapbox's own attribution left on;PEEK_SNAPrenamed. Each reddens exactly its own case and nothing else.⚠ What this push did NOT measure, and where to check it
This environment holds no
VITE_MAPBOX_ACCESSTOKEN, so no local browser could render the real basemap, the wordmark or the real attribution text, and a routine never waits for CI to publish a preview.Splitting the corners also retires the one measurement the adversarial pass had: it read the earlier preview in Chromium and found the top-right column at 42×42 — the locate button alone — clear in both layouts. That still covers the ⓘ, which now stacks second in that column rather than third. What a browser still owes is the wordmark's new corner: that
bottom-rightis genuinely clear of the side panel at 1280×800, that the ⓘ's expanded text opens on screen from the right edge, and that the sheet covering the wordmark at 390×844 looks like the accepted exception rather than a bug. One look at each size on the next CI preview settles all three.Manual verification
Notes for reviewer
ee97071is your own one-line move of the wordmark, andbed7f65,296ddcb,7122d24andb531b3ebring the spec, the comments and the docs in line behind it.GeolocateControlhas shared it with the cog since before this branch. The thread carries the two options, and A — leave it, RTL is deferred repo-wide — is still the recommendation.!inset-0and covers the whole frame, the credits included — but it covers the map too, so no map is on screen to attribute. Atlgit insets by 16px.origin/mainatf9ed7d3, cleanly, no conflicts. The lean gate above ran on that merge, so fix(calendar): the view switch lights an option a phone cannot render #337's calendar change is covered by it.Detail
Why two construction-time props are enough now, and were not before. Each is read once and has no setter, which is exactly why a corner that follows the layout could not use them — and why one that never moves can:
logoPositionis read in theMapconstructor, and react-map-gl leaves it out ofsettingNames, its reconciliation whitelist.LogoControlis not in mapbox-gl's export list, so the logo cannot be removed and re-added either.useControladds a control in auseEffectwith[]deps, so a control'spositionis read once too.What splitting the corners costs, and what it does not. Mapbox's corner containers float and
clear: both, so controls in one container stack vertically. Two corners therefore means the top right is a column of two rather than three, and[data-sy-expanded]'s 40px nudge clears both of them exactly as before. What it does cost is the wordmark's visibility on a phone — the whole reason the earlier version measured.Why the attribution shows at all.
_updateAttributionscollectssource.attributiononly from source caches a layer actually uses, which is why a style with no used source renders an empty, hidden control. The app's real styles carry Mapbox and OpenStreetMap attribution on their vector sources.What the spec pins now. Three couplings, each silent if it breaks: exactly one attribution, and that it is ours rather than mapbox's own; the ⓘ at
top-right, derived fromDrawerStack's ownPEEK_SNAPrather than a restated number; and the wordmark atbottom-right, which guards the half of #324 that is still a live defect — mapbox's default bottom left, under the side panel. No case asserts the narrow sheet covering the wordmark, since that is now the accepted outcome.The per-edit ceiling is unchanged at 17. The rewritten spec still reads repo source through
readRepoSource, so it still takes its one slot in the selection forsrc/test-support/repo-source.ts. It reads two files, which costs no slot either way.Closes #324 — with the accepted exception named under Notes for reviewer.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CLL6hhnF1c1Tof2EGLJPim