feat: clipboard export, persisted bearing, and poster presets#127
Open
ehabmansour1 wants to merge 3 commits into
Open
feat: clipboard export, persisted bearing, and poster presets#127ehabmansour1 wants to merge 3 commits into
ehabmansour1 wants to merge 3 commits into
Conversation
Use the Clipboard API to copy the composited poster as a PNG image directly to the system clipboard. A new teal "Copy" button appears in both the desktop flyout and the mobile export modal. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move map bearing from local PreviewPanel state into PosterForm so it survives across interactions, is included in presets, and syncs via MapPreview alongside center and zoom. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a Presets accordion section that stores up to 20 named poster configurations (form + custom colors) in localStorage. Users can save the current state, load a preset to restore it, or delete presets they no longer need. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
|
@ehabmansour1 thank you for your contribution again! Before proceeding please consider this: Updated Contributing Guidelines & New CLAThe project license was recently updated to AGPL-3.0 with dual-licensing rights, but the Contributing Guidelines were not updated at the same time, and the project did not yet have a standalone Contributor License Agreement. Your PR was opened during that gap, so this step is necessary before I can proceed with review. Both documents are now in place. Please take a moment to review them:
I need your confirmation before I can proceed with reviewing your code. Please reply to this comment with the following:
If you have any questions, feel free to ask here. Thank you for understanding! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three additive features that improve the poster authoring loop:
navigator.clipboard.writewithClipboardItemto put a PNG of the composited poster on the system clipboard.bearingis now aPosterFormfield, so map rotation survives across interactions, syncs throughMapPreviewalongside center/zoom (with a newMAP_BEARING_SYNC_EPSILON), and is captured by presets. LocalmapBearingstate inPreviewPanelwas removed.src/features/presets/(domain / infrastructure / application / ui). Saves up to 20 named configurations (PosterForm+customColors) tolocalStorageunder a stable key (terraink:presets), no TTL. Surfaces as a new "Presets" accordion section inSettingsPanel.Each feature is in its own commit so they can be reviewed (or reverted) independently.
Architecture notes
features/export/infrastructure/, re-exported fromfeatures/export/infrastructure/index.tsandcore/services.ts. Hook handles dispatch of the new"clipboard"ExportFormatbranch insideuseExport.exportPoster.mapExporter.ts/exportUtils.ts.localStorageCachebecause that adapter enforces a TTL and namespaces byAPP_VERSION(presets would be wiped on every release). Uses a plain stable key instead, mirroring how custom marker icons use IndexedDB for durable user data.SET_THEME(resetscustomColors) →SET_FORM_FIELDS→ per-colorSET_COLOR, reusing existing reducer actions instead of adding a newLOAD_PRESETaction.Test plan
localStoragebun run buildpasses (verified locally)Notes
pngExporter.ts,StartupLocationModal.tsx, andtypography.tsare unrelated to this PR and untouched.