diff options
| author | David Hill <[email protected]> | 2025-12-21 16:45:49 +0000 |
|---|---|---|
| committer | adamelmore <[email protected]> | 2026-01-26 15:35:09 -0600 |
| commit | a77df3c17482fce94a19554283bdba6f03135f67 (patch) | |
| tree | 23993b7dce6df37eb92349b9e86040a0b60e3a8b /packages/app/src/lib | |
| parent | 9d1cf98192fdcfb9a76044c0cb9818565198a769 (diff) | |
| download | opencode-a77df3c17482fce94a19554283bdba6f03135f67.tar.gz opencode-a77df3c17482fce94a19554283bdba6f03135f67.zip | |
wip: new release modal
- highlight key updates or new features
- needs some transition love
- all copy including text and video placeholder
Diffstat (limited to 'packages/app/src/lib')
| -rw-r--r-- | packages/app/src/lib/release-notes.ts | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/packages/app/src/lib/release-notes.ts b/packages/app/src/lib/release-notes.ts new file mode 100644 index 000000000..a28843acd --- /dev/null +++ b/packages/app/src/lib/release-notes.ts @@ -0,0 +1,53 @@ +import { CURRENT_RELEASE } from "@/components/dialog-release-notes" + +const STORAGE_KEY = "opencode:last-seen-version" + +// ============================================================================ +// DEV MODE: Set this to true to always show the release notes modal on startup +// Set to false for production behavior (only shows after updates) +// ============================================================================ +const DEV_ALWAYS_SHOW_RELEASE_NOTES = true + +/** + * Check if release notes should be shown + * Returns true if: + * - DEV_ALWAYS_SHOW_RELEASE_NOTES is true (for development) + * - OR the current version is newer than the last seen version + */ +export function shouldShowReleaseNotes(): boolean { + if (DEV_ALWAYS_SHOW_RELEASE_NOTES) { + console.log("[ReleaseNotes] DEV mode: always showing release notes") + return true + } + + const lastSeen = localStorage.getItem(STORAGE_KEY) + if (!lastSeen) { + // First time user - show release notes + return true + } + + // Compare versions - show if current is newer + return CURRENT_RELEASE.version !== lastSeen +} + +/** + * Mark the current release notes as seen + * Call this when the user closes the release notes modal + */ +export function markReleaseNotesSeen(): void { + localStorage.setItem(STORAGE_KEY, CURRENT_RELEASE.version) +} + +/** + * Get the current version + */ +export function getCurrentVersion(): string { + return CURRENT_RELEASE.version +} + +/** + * Reset the seen status (useful for testing) + */ +export function resetReleaseNotesSeen(): void { + localStorage.removeItem(STORAGE_KEY) +} |
