Skip to content

feat: add X-App-Source header to Nova + remove notify checkbox#926

Merged
MaheshtheDev merged 13 commits into
mainfrom
vorflux/email-notifications-nova-headers
May 11, 2026
Merged

feat: add X-App-Source header to Nova + remove notify checkbox#926
MaheshtheDev merged 13 commits into
mainfrom
vorflux/email-notifications-nova-headers

Conversation

@MaheshtheDev
Copy link
Copy Markdown
Member

@MaheshtheDev MaheshtheDev commented May 10, 2026

Summary

Adds X-App-Source: nova header to all Nova API clients and removes the "notify when deleted" checkbox from the account deletion dialog. This is the companion PR to the main email notifications feature in the mono repo.

Companion PR: supermemoryai/mono — Email notifications for lifecycle events

What Changed

X-App-Source Header

  • packages/lib/api.ts$fetch sends X-App-Source: nova via onRequest hook (survives per-request header overrides)
  • packages/lib/auth.tsauthClient sends X-App-Source: nova header
  • apps/web/app/layout.tsxAutumnProvider receives headers={{ "X-App-Source": "nova" }} prop
  • apps/web/hooks/use-account-settings.ts — all 3 raw fetch calls include X-App-Source: nova

Notify Checkbox Removal

  • apps/web/components/settings/account.tsx — removed notifyWhenDeleted state, checkbox UI, and notifyOnComplete parameter from the delete account call

Why

The backend uses this header to determine which email template variant to send (developer vs consumer). Account deletion emails are now always sent (no longer opt-in), so the checkbox is removed.

Testing

Type Checking

  • packages/lib/api.ts: Clean
  • apps/web: 1 new TS2322 on layout.tsx:57AutumnProvider types from autumn-js/react don't declare headers prop yet, but it's supported at runtime. Added @ts-expect-error with tracking comment.
  • Other errors in apps/web and packages/tools are pre-existing across unrelated files

Linting

  • All 5 changed files pass Biome lint cleanly with zero errors

X-App-Source Header Coverage Audit

  • All Nova entry points verified: $fetch (with onRequest guard), authClient, AutumnProvider, and all 3 manual fetch calls in use-account-settings.ts carry "nova"

Checkbox Removal Audit

  • Confirmed notifyWhenDeleted and checkbox JSX fully removed from account.tsx

Session Details

…ckbox

- Add X-App-Source: nova header to $fetch, authClient, AutumnProvider, and raw fetch calls
- Remove notify-when-deleted checkbox from account deletion dialog (emails now always sent)
Add onRequest hook to Nova $fetch client so X-App-Source: nova is
always injected even when individual calls pass their own headers
object (which shallow-replaces the createFetch defaults).
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 10, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
supermemory-mcp 3926da4 May 11 2026, 03:39 PM

@claude
Copy link
Copy Markdown

claude Bot commented May 10, 2026

Claude finished @MaheshtheDev's task in 1m 38s —— View job


Review Complete

  • Fetching PR diff and existing comments
  • Analyzing changed files for bugs and security issues
  • Checking surrounding code context
  • Submitting review

Overview: Adds X-App-Source: nova header across all Nova API entry points and removes the opt-in notification checkbox from account deletion flow.

Issues found: None — this looks good to ship.

The implementation is well thought out:

  • The onRequest hook in $fetch correctly ensures the header survives per-request header overrides
  • Header additions are consistent across $fetch, authClient, AutumnProvider, and manual fetch calls
  • The checkbox removal is clean with all related state and UI properly removed

Score: 10/10

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 10, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
supermemory-app 3926da4 Commit Preview URL

Branch Preview URL
May 11 2026, 03:40 PM

@MaheshtheDev MaheshtheDev marked this pull request as draft May 11, 2026 02:09
@MaheshtheDev MaheshtheDev marked this pull request as ready for review May 11, 2026 09:36
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview: Adds X-App-Source: nova header across all Nova API entry points and removes the opt-in notification checkbox from account deletion flow.

Issues found: None — this looks good to ship.

The implementation is well thought out:

  • The onRequest hook in $fetch correctly ensures the header survives per-request header overrides
  • Header additions are consistent across $fetch, authClient, AutumnProvider, and manual fetch calls
  • The checkbox removal is clean with all related state and UI properly removed
  • The notifyOnComplete parameter remains in useDeleteUserAccount for backwards compatibility but is no longer passed from the UI, which aligns with the backend change to always send emails

Score: 10/10

@ishaanxgupta
Copy link
Copy Markdown
Contributor

Can we verify this works with our installed autumn-js@1.2.12?
https://docs.useautumn.com/react/hooks/autumn-provider The docs show headers on AutumnProvider, but the installed provider here doesn’t seem to forward that prop to AutumnClient, so X-App-Source: nova may not actually be sent on Autumn requests.

MaheshtheDev and others added 9 commits May 11, 2026 15:38
Co-authored-by: ved015 <vedant.04.mahajan@gmail.com>
…920)

## Summary

Addresses user feedback about the graph view: content in node popovers was hard-truncated at 100 characters with no way to read the full text or navigate to the document.

### Changes

**Scrollable popover content (no more truncation)**
- Removed the `truncate(content, 100)` call -- full content is now rendered in the popover
- Made the content area scrollable with `maxHeight: 100px` and `overflowY: auto`
- Increased version timeline entry truncation from 60 to 120 characters
- Increased version timeline container height from 120px to 160px

**"View document" in shortcuts panel**
- Added an eye icon + "View document" entry to the shortcuts panel (alongside existing arrow navigation)
- Clicking opens the Document Modal for the corresponding document
- Works for both document nodes (opens that document) and memory nodes (opens the parent document)
- Popover is automatically dismissed before the modal opens (prevents z-index overlap)
- Wired `onOpenDocument` callback through the full component chain: `page.tsx` -> `GraphLayoutView` -> `MemoryGraph` wrapper -> `MemoryGraphBase` -> `NodeHoverPopover`

**Shortcuts panel visual cleanup**
- Icon badges (`KeyBadge`) retain dark background and border for a keyboard-key badge look
- All icons (including the new EyeIcon) are uniformly wrapped in `KeyBadge` for consistent styling
- Removed background, border, and border-radius from the shortcuts panel container itself
- Widened shortcuts panel from 100px to 160px so navigation labels are fully visible

**Type safety improvement**
- Changed `MemoryGraphProps.colors` from `GraphThemeColors` to `Partial<GraphThemeColors>` to match actual usage (callers pass partial overrides that get merged with defaults)
- Replaced `as Partial<typeof import(...)>` cast with proper `satisfies Partial<GraphThemeColors>` using a direct type import

### Files changed
- `packages/memory-graph/src/components/node-hover-popover.tsx` -- scrollable content, EyeIcon + "View document" in shortcuts, KeyBadge styling, NavButton icon type broadened to `React.ReactNode`, all icons wrapped in KeyBadge
- `packages/memory-graph/src/components/memory-graph.tsx` -- popover dismissal wrapper (`handleOpenDocument`), prop forwarding
- `packages/memory-graph/src/types.ts` -- `onOpenDocument` prop on `MemoryGraphProps`, `colors` changed to `Partial<GraphThemeColors>`
- `apps/web/components/graph-layout-view.tsx` -- accepts and passes `onOpenDocument`
- `apps/web/components/memory-graph/memory-graph-wrapper.tsx` -- `onOpenDocument` in wrapper props, clean type import
- `apps/web/app/(app)/page.tsx` -- `handleOpenDocumentById` handler, wired to `GraphLayoutView`

## Testing

### Unit Tests (154/154 passed)
- **Command:** `cd packages/memory-graph && bun run test`
- **Result:** 9 test files, 154 tests passed (107 existing + 47 new)
- **New test file:** `packages/memory-graph/src/__tests__/node-hover-popover.test.tsx` covering:
  - Layout constants (`SHORTCUTS_W=160`, `CARD_W=280`, `TOTAL_W` formula)
  - Content area scrollability (`maxHeight:100`, `overflowY:auto`, `flex:1 1 auto`, no truncation)
  - KeyBadge styles (has `backgroundColor: colors.controlBg`, has `border` with `colors.controlBorder`)
  - Shortcuts panel styles (no `backgroundColor`, no `border`, no `borderRadius`)
  - EyeIcon SVG component (`aria-hidden`, viewBox, path, circle, stroke)
  - "View document" button render guard (`onOpenDocument && documentId`)
  - `documentId` derivation (memory vs document node)
  - VersionTimeline truncation limit (120 chars) and container maxHeight (160)
  - `onOpenDocument` prop wiring
  - NavButton icon prop type (`React.ReactNode`), all icons wrapped in KeyBadge
  - `handleOpenDocument` wrapper in MemoryGraph (dismiss calls, ordering, useCallback deps)

### Build
- **Command:** `bun run --filter=@supermemory/memory-graph build`
- **Result:** Build succeeds, 0 errors

### Lint/Format
- **Command:** `bunx biome ci --changed --since=origin/main --no-errors-on-unmatched`
- **Result:** 6 files checked, no fixes applied, 0 errors

### Type Checking
- `packages/memory-graph`: 0 errors
- `apps/web`: 0 new errors introduced

### CI
- "CI - Type Check, Format & Lint" workflow passes
- "Claude Code Review" workflow fails due to repo config (`non-human actor: vorflux` not in `allowed_bots` list) -- not related to code changes

---
**Session Details**
- Session: [View Session](https://supermemory.us1.vorflux.com/agent-sessions/d0c067f1-38c1-40c5-ada9-b2ffb7331d1c)
- Requested by: Mahesh Sanikommu (mahesh@supermemory.com)
- Address comments on this PR. Add `(aside)` to your comment to have me ignore it.
@vorflux
Copy link
Copy Markdown
Contributor

vorflux Bot commented May 11, 2026

Verified — autumn-js@1.2.12 fully supports the headers prop on AutumnProvider. Here's the chain:\n\n1. AutumnProvider destructures headers from props and passes it to createAutumnClient({ headers }) (AutumnProvider.js L2067-2089)\n2. createAutumnClient forwards it to createHttpClient({ headers: config.headers }) (AutumnProvider.js L1991)\n3. createHttpClient spreads customHeaders into every request: { "Content-Type": "application/json", ...customHeaders } (AutumnProvider.js L1942-1944)\n\nThe TypeScript types also declare it correctly in AutumnProvider.d.ts:10:\nts\ntype AutumnProviderProps = {\n headers?: Record<string, string>;\n // ...\n};\n\n\nI've also removed the @ts-expect-error comment that was added earlier — it's not needed since the types are correct in this version.

@ishaanxgupta
Copy link
Copy Markdown
Contributor

Okay lgtm!

@MaheshtheDev MaheshtheDev merged commit 6437814 into main May 11, 2026
7 of 8 checks passed
@graphite-app graphite-app Bot requested a review from Dhravya May 12, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants