Skip to content

Commit 3f49cd4

Browse files
committed
feat: add compact scheme sharing URLs
1 parent eb55f7d commit 3f49cd4

24 files changed

Lines changed: 1569 additions & 539 deletions

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ Early history is grouped by day to keep the file readable while still covering t
66

77
## 2026
88

9+
### 2026-05-10
10+
11+
- Added compact `s` query-string serialization for complete scheme settings while keeping backward compatibility with legacy shared URLs.
12+
- Added mintty drag-and-drop URL payload support so generated palettes can be dropped into mintty from shared links.
13+
- Updated social sharing and browser URL synchronization to use the compressed scheme settings and mintty drag payload.
14+
- Extended unit and browser smoke coverage for compressed settings, legacy URL hydration, sharing URLs, and mintty drag serialization.
15+
916
### 2026-04-22
1017

1118
- Completed the Vue migration of the remaining UI pieces.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ Project structure:
8181

8282
* `src/domain` - pure scheme rules, defaults, color naming, and color-mode logic
8383
* `src/application` - synchronization/use-case layer that applies domain logic to app state
84-
* `src/infrastructure` - URL/query codecs, export serializers, browser sync, and wrapped legacy vendor code
84+
* `src/infrastructure/url` - URL/query codecs, share URL builders, and URL-only scheme settings formats
85+
* `src/infrastructure/serialization` - terminal export serializers
86+
* `src/infrastructure/browser` - browser URL/storage synchronization
87+
* `src/infrastructure/vendor` - wrapped legacy vendor code
8588
* `src/presentation` - Vue components, Pinia stores, fonts, and styles
8689
* `public` - static assets copied to the final build, including images and SEO files
8790

src/infrastructure/browser/scheme-url-sync.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { useSchemeStore } from '../../presentation/stores/scheme';
2+
import { calculateSchemeColors } from '../../domain/scheme/color-scheme-calculator';
23
import {
34
buildSchemeQueryParams,
45
buildSchemeSearch,
56
readSchemeFromSearch,
67
SCHEME_QUERY_KEYS,
78
serializeSearchParams,
8-
} from '../serialization/scheme-query';
9+
} from '../url/scheme-query';
10+
import { buildMinttyDragSchemeHash } from '../url/mintty-drag-scheme';
911
export const SCHEME_STORAGE_KEY = '4bit:scheme-search';
1012

1113
function browserWindow() {
@@ -105,6 +107,10 @@ function replaceLocationSearch(nextSearch, location, history) {
105107
}
106108
}
107109

110+
function buildSchemeHash(scheme) {
111+
return buildMinttyDragSchemeHash(calculateSchemeColors(scheme));
112+
}
113+
108114
export function hydrateSchemeStoreFromLocation(pinia, options = browserLocation().search) {
109115
const settings = typeof options === 'string'
110116
? { search: options }
@@ -165,7 +171,11 @@ export class SchemeUrlSync {
165171
});
166172

167173
const nextSearch = serializeSearchParams(currentParams);
168-
const nextUrl = `${this.location.pathname}${nextSearch ? `?${nextSearch}` : ''}${this.location.hash}`;
174+
const nextUrl = [
175+
this.location.pathname,
176+
nextSearch ? `?${nextSearch}` : '',
177+
buildSchemeHash(scheme),
178+
].join('');
169179
const currentUrl = `${this.location.pathname}${this.location.search}${this.location.hash}`;
170180

171181
if (nextUrl !== currentUrl) {

0 commit comments

Comments
 (0)