Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ec7a5a5
feat: add feature announcements
janburzinski Jun 23, 2026
aad0104
feat: present announcements as toast
janburzinski Jun 23, 2026
e7b5e43
style: polish announcement presentation
janburzinski Jun 23, 2026
e5d22f1
chore: add announcement dev controls
janburzinski Jun 23, 2026
c50afd1
style: simplify announcement hover states
janburzinski Jun 23, 2026
098f9b7
refactor: make announcements toast-only
janburzinski Jun 23, 2026
7fb8648
test: validate announcement manifest
janburzinski Jun 23, 2026
515da3f
fix(announcements): narrow CTA actions
janburzinski Jun 23, 2026
b3dea47
test(announcements): guard schema drift
janburzinski Jun 23, 2026
afbe110
refactor(announcements): isolate toast effects
janburzinski Jun 23, 2026
0684b10
fix(announcements): show dev preview directly
janburzinski Jun 23, 2026
f18ae68
fix(announcements): persist dismissals in settings
janburzinski Jun 23, 2026
d9fdd00
fix(announcements): address review feedback
janburzinski Jun 23, 2026
9f24adb
feat(announcements): move announcement to sidebar
janburzinski Jun 23, 2026
5546daf
feat(announcements): show announcement toast
janburzinski Jun 24, 2026
cf91d72
fix(announcements): remove feature icons
janburzinski Jun 24, 2026
595075d
style(announcements): format schema import
janburzinski Jun 24, 2026
14aa952
test(announcements): type schema required field
janburzinski Jun 24, 2026
ac9ac57
feat: add sidebar changelog toast
janburzinski Jun 26, 2026
ba55d31
fix(announcements): gate toast display
janburzinski Jun 26, 2026
a050b26
refactor(announcements): trim toast manifest
janburzinski Jun 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions apps/emdash-desktop/feature-announcements.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"$id": "feature-announcements.schema.json",
"title": "Emdash feature announcement manifest",
"description": "In-app feature announcement shown as a bottom-left sidebar toast. Runtime validation uses the Zod schema in src/shared/feature-announcements/schema.ts — keep both in sync.",
"type": "object",
"additionalProperties": false,
"required": ["id", "title", "changelogUrl"],
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"description": "Set to false to hide the announcement without deleting content."
},
"id": {
"type": "string",
"minLength": 1,
"description": "Stable identifier used for dismissal persistence."
},
"eyebrow": {
"type": "string",
"minLength": 1,
"default": "Now available"
},
"title": {
"type": "string",
"minLength": 1
},
"changelogUrl": {
"type": "string",
"format": "uri"
},
"minAppVersion": {
"type": "string",
"minLength": 1,
"description": "Semver minimum; older app versions ignore this manifest."
},
"cta": {
"$ref": "#/$defs/cta"
}
},
"$defs": {
"cta": {
"type": "object",
"additionalProperties": false,
"properties": {
"action": {
"type": "string",
"enum": ["open-automations"]
},
"url": {
"type": "string",
"format": "uri"
}
},
"oneOf": [
{
"required": ["action"],
"not": {
"required": ["url"]
}
},
{
"required": ["url"],
"not": {
"required": ["action"]
}
}
]
Comment thread
janburzinski marked this conversation as resolved.
}
}
}
22 changes: 22 additions & 0 deletions apps/emdash-desktop/feature-announcements.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#:schema ./feature-announcements.schema.json
#
# In-app feature announcement shown as a bottom-left sidebar toast.
#
# Edit this file on GitHub to announce major features without shipping a new app
# release. Set `enabled = false` to hide the toast while keeping content around
# for the next launch.
#
# Runtime validation: src/shared/feature-announcements/schema.ts (Zod).
# Editor/CI schema: feature-announcements.schema.json (keep in sync with Zod).
#
# The app fetches this file from the main branch at startup.

enabled = true
id = "automations-2026-06"
eyebrow = "Now available"
title = "Emdash Automations"
changelogUrl = "https://emdash.sh/changelog"
minAppVersion = "1.1.27"

[cta]
action = "open-automations"
4 changes: 2 additions & 2 deletions apps/emdash-desktop/src/main/app/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
menuRedoChannel,
menuUndoChannel,
} from '@shared/events/appEvents';
import { EMDASH_DOCS_URL, EMDASH_ISSUES_NEW_URL, EMDASH_RELEASES_URL } from '@shared/urls';
import { EMDASH_CHANGELOG_URL, EMDASH_DOCS_URL, EMDASH_ISSUES_NEW_URL } from '@shared/urls';
import { getMainWindow } from './window';

function copyInstallationId(): void {
Expand Down Expand Up @@ -168,7 +168,7 @@ export function setupApplicationMenu(): void {
{
label: 'Changelog',
click: () => {
void shell.openExternal(EMDASH_RELEASES_URL);
void shell.openExternal(EMDASH_CHANGELOG_URL);
},
},
{ type: 'separator' as const },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { createRPCController } from '@shared/lib/ipc/rpc';
import { featureAnnouncementsService } from './service';

export const featureAnnouncementsController = createRPCController({
getCurrent: async () => {
try {
const manifest = await featureAnnouncementsService.getCurrent();
return { success: true as const, data: manifest };
} catch (error) {
return {
success: false as const,
error: error instanceof Error ? error.message : String(error),
};
}
},
preview: async () => {
if (!import.meta.env.DEV) {
return { success: false as const, error: 'Preview is only available in development builds' };
}

try {
const manifest = await featureAnnouncementsService.preview();
return { success: true as const, data: manifest };
} catch (error) {
return {
success: false as const,
error: error instanceof Error ? error.message : String(error),
};
}
},
});
115 changes: 115 additions & 0 deletions apps/emdash-desktop/src/main/core/feature-announcements/service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
import { app } from 'electron';
import semver from 'semver';
import * as toml from 'smol-toml';
import { resolveAppVersion } from '@main/core/app/utils';
import { log } from '@main/lib/logger';
import {
FEATURE_ANNOUNCEMENT_MANIFEST_FILENAME,
FEATURE_ANNOUNCEMENT_MANIFEST_URL,
} from '@shared/feature-announcements/constants';
import {
parseFeatureAnnouncementManifest,
parseFeatureAnnouncementManifestRaw,
type FeatureAnnouncementManifest,
} from '@shared/feature-announcements/schema';

const MANIFEST_CACHE_TTL_MS = 15 * 60 * 1000;

type CachedManifest = {
fetchedAt: number;
manifest: FeatureAnnouncementManifest | null;
};

class FeatureAnnouncementsService {
private cache: CachedManifest | null = null;

async getCurrent(): Promise<FeatureAnnouncementManifest | null> {
const manifest = await this.loadManifest();
if (!manifest) return null;

if (manifest.minAppVersion) {
const currentVersion = await resolveAppVersion();
const min = semver.coerce(manifest.minAppVersion);
const current = semver.coerce(currentVersion);
if (min && current && semver.lt(current, min)) {
return null;
}
}

return manifest;
}

async preview(): Promise<FeatureAnnouncementManifest | null> {
const content = await this.readManifestContent();
if (!content) return null;

try {
return parseFeatureAnnouncementManifestRaw(toml.parse(content));
} catch (error) {
log.warn('[feature-announcements] Failed to parse preview manifest', error);
return null;
}
}

private async loadManifest(options?: {
bypassCache?: boolean;
}): Promise<FeatureAnnouncementManifest | null> {
if (
!options?.bypassCache &&
this.cache &&
Date.now() - this.cache.fetchedAt < MANIFEST_CACHE_TTL_MS
) {
return this.cache.manifest;
}

const content = await this.readManifestContent();
if (!content) {
this.cache = { fetchedAt: Date.now(), manifest: null };
return null;
}

try {
const parsed = parseFeatureAnnouncementManifest(toml.parse(content));
this.cache = { fetchedAt: Date.now(), manifest: parsed };
return parsed;
} catch (error) {
log.warn('[feature-announcements] Failed to parse manifest', error);
this.cache = { fetchedAt: Date.now(), manifest: null };
return null;
}
}

private async readManifestContent(): Promise<string | null> {
if (import.meta.env.DEV) {
try {
const localPath = join(app.getAppPath(), FEATURE_ANNOUNCEMENT_MANIFEST_FILENAME);
return await readFile(localPath, 'utf8');
} catch (error) {
log.debug(
'[feature-announcements] Local manifest unavailable, falling back to remote',
error
);
}
}

try {
const response = await fetch(FEATURE_ANNOUNCEMENT_MANIFEST_URL, {
headers: { 'Cache-Control': 'no-cache' },
});
if (!response.ok) {
log.warn('[feature-announcements] Remote manifest request failed', {
status: response.status,
});
return null;
}
return await response.text();
} catch (error) {
log.warn('[feature-announcements] Remote manifest fetch failed', error);
return null;
}
}
}

export const featureAnnouncementsService = new FeatureAnnouncementsService();
7 changes: 7 additions & 0 deletions apps/emdash-desktop/src/main/core/settings/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ export const changesViewModeSchema = z.object({

export const browserPreviewSettingsSchema = z.object({ enabled: z.boolean() });

export const announcementSettingsSchema = z.object({
initialized: z.boolean(),
dismissedIds: z.array(z.string()),
});

export const browserProfileIdSchema = z
.string()
.regex(/^[a-z0-9][a-z0-9-]{0,63}$/)
Expand Down Expand Up @@ -145,6 +150,7 @@ export const APP_SETTINGS_SCHEMA_MAP = {
interface: interfaceSettingsSchema,
terminal: terminalSettingsSchema,
browserPreview: browserPreviewSettingsSchema,
announcements: announcementSettingsSchema,
browser: browserSettingsSchema,
resourceMonitor: resourceMonitorSettingsSchema,
changesViewMode: changesViewModeSchema,
Expand All @@ -162,6 +168,7 @@ export const appSettingsSchema = z.object({
interface: interfaceSettingsSchema,
terminal: terminalSettingsSchema,
browserPreview: browserPreviewSettingsSchema,
announcements: announcementSettingsSchema,
browser: browserSettingsSchema,
resourceMonitor: resourceMonitorSettingsSchema,
changesViewMode: changesViewModeSchema,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ export const SETTINGS_DEFAULTS = {
browserPreview: {
enabled: true,
},
announcements: {
initialized: false,
dismissedIds: [] as string[],
},
browser: {
defaultProfileId: DEFAULT_BROWSER_PROFILE_ID,
relaxCorsForLocalhost: false,
Expand Down
2 changes: 2 additions & 0 deletions apps/emdash-desktop/src/main/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { automationsController } from './core/automations/controller';
import { browserController } from './core/browser/controller';
import { conversationController } from './core/conversations/controller';
import { editorBufferController } from './core/editor/controller';
import { featureAnnouncementsController } from './core/feature-announcements/controller';
import { featurebaseController } from './core/featurebase/controller';
import { forgejoController } from './core/forgejo/controller';
import { filesController } from './core/fs/controller';
Expand Down Expand Up @@ -56,6 +57,7 @@ export const rpcRouter = createRPCRouter({
pty: ptyController,
resourceMonitor: resourceMonitorController,
asana: asanaController,
featureAnnouncements: featureAnnouncementsController,
featurebase: featurebaseController,
forgejo: forgejoController,
github: githubController,
Expand Down
Loading
Loading