Repository navigation
Description
Context
ProPR currently generates Inbox notifications and Web Push deliveries for every monitored repository. The single producer of repository-scoped lifecycle notifications is NotificationProjectionService (packages/api/services/notificationProjectionService.ts), which turns draft, task, and indexing lifecycle events into durable notification events.
Teams that monitor many repositories want to keep automation running for a repository (issues processed, PRs reviewed, indexing kept fresh) while silencing its notification noise. Today the only way to do that is to turn off the entire notification category in personal Settings, which is global and affects every repository.
This issue adds a per-repository Notifications toggle to the Repositories → Settings tab. It behaves exactly like the existing repository-level automation toggles (Auto CI follow-up, Visual previews): it is stored in the monitored-repository configuration, shared across all branch entries of the same repository, and written through POST /api/config/repos.
Key behaviours requested:
- The option lives in the Repositories → Settings tab for the selected repository.
- It is enabled by default. Existing repositories, and repositories created before this change, must behave exactly as they do today.
- Because it is on by default, it is not shown in the Add Repository modal.
- When disabled it acts as a pure filter: no notification is generated (and therefore none is pushed) for that repository.
Requirements
Functional
- A new boolean
notificationsEnabledfield on monitored repository configuration, defaulting totrue. - A toggle in
RepositorySettingsBarlabelled Notifications, with helper text explaining that it controls Inbox and push notifications for this repository. - The toggle is shared across all configured branch entries of the same repository (identical to
autoFollowupOnFailedCiandvisualPreview). Toggling it writes the same value to every entry whose repository name matches (case-insensitively). - When
notificationsEnabledisfalse,NotificationProjectionServicemust not create:- plan-ready notifications for drafts in that repository,
- task failure / implementation-completed / review-completed / PR-attention notifications for that repository,
- indexing-failure notifications for that repository,
- stalled task or stalled indexing notifications for that repository.
- System-health notifications (
system_failure, including the ProPR Connect seat-limit card) are not repository-scoped and must continue to be produced regardless of this setting. - The value round-trips through
GET /api/config/repos,POST /api/config/repos, the instance catalog (member view), the CLI, and the MCPupdate_repository_configurationtool. - Read-only users (demo mode, or users without
instance.manage_settings) see the toggle but cannot change it.
Non-functional / constraints
- No database migration. Monitored repositories are stored as JSON in the
system_configstable, so the new field is additive and requires no schema change. - The filter lookup runs inside the notification background worker. It must not block the API event loop, must use the injected Knex connection (not the
@propr/coremodule singleton), must be cached with a short TTL, and must fail open (generate the notification) if the configuration cannot be read — silently swallowing notifications on a transient read error would be worse than a small amount of extra noise. - Backwards compatibility: a stored repository entry that omits
notificationsEnabled, or a legacy string entry ("owner/repo"), is treated as enabled.
Implementation Specification
Files to touch, in dependency order:
| Layer | File | Change |
|---|---|---|
| Core types | packages/core/src/config/configManager.ts (RepoToMonitor) |
Add optional notificationsEnabled?: boolean |
| API validation | packages/api/routes/configRepoValidation.ts |
Normalize + validate the field; add preserveRepoNotifications |
| API persistence | packages/api/routes/configRoutes.ts |
Apply the new preserve helper alongside the existing ones |
| Notification filter | packages/api/services/notificationProjectionService.ts |
Cached repository lookup + guards in every repository-scoped projection |
| UI types | propr-ui/src/api/proprTypes.ts (MonitoredRepo) |
Add notificationsEnabled?: boolean |
| UI merge rules | propr-ui/src/hooks/repositoryVisualPreview.ts |
Resolve + unify the value across branch entries |
| UI state | propr-ui/src/hooks/useRepositoryManagement.ts |
Parse, expose, and toggle the value |
| UI control | propr-ui/src/components/RepositorySettingsBar.tsx |
Render the toggle |
| UI page wiring | propr-ui/src/pages/RepositoriesPage.tsx |
Pass the handler through |
| CLI | packages/cli/src/api/repos.ts, packages/cli/src/commands/repoCommands.ts |
Type, defaults, --no-notifications, list column |
The exact code, with reasoning, is in the Implementation section below.
Resolution rule (must be identical on both sides)
A repository may have several configuration entries (one per monitored branch). Define:
Notifications are disabled for a repository only when every configured entry for that repository name has
notificationsEnabled === false. Otherwise they are enabled.
This rule is deliberately fail-open: any entry that is missing the field, or explicitly true, keeps notifications on. The UI writes the same value to every entry, so the two sides can never diverge in practice; the rule only matters for hand-edited or legacy configuration.
Acceptance Criteria
- Selecting a repository in Repositories → Settings shows a Notifications toggle, checked by default for every existing repository.
- Turning the toggle off persists
notificationsEnabled: falseto all configuration entries of that repository (verified by thePOST /api/config/reposbody), and the save-status footer reportsSaved. - Reloading the page keeps the toggle off.
- With the toggle off, none of the following create a row in
notification_eventsfor that repository: a completed/failed task, a completed review, a PR ready for review, a plan reachingreview, a failed indexing run, or a stalled task/indexing sweep. - With the toggle off, an unhealthy system-health snapshot still creates a
system_failurenotification. - With the toggle on (default), notification behaviour is byte-for-byte unchanged from before this issue.
- The Add Repository modal is unchanged — no Notifications control is added there — and newly added repositories are persisted with
notificationsEnabled: true. - Read-only users see the toggle rendered and
disabled; noPOST /api/config/reposrequest is issued when they click it. GET /api/config/reposreturnsnotificationsEnabledfor every repository, defaulting totruefor entries stored without the field.propr repo listshows the notification state, andpropr repo add owner/name --no-notificationspersistsfalse.- All new and existing tests pass:
npm run test:server,npm run test:notifications,npm --workspace propr-ui test, and therepositories-settings.pw.tsPlaywright suite.
Out of scope (do not implement here)
- Retroactive cleanup. Notifications created before the toggle was turned off remain in the Inbox. They can be dismissed normally. Add a follow-up issue if bulk dismissal on disable is wanted.
- Desktop native task alerts.
DesktopTaskNotificationAdapterrenders OS-level alerts from the live task socket stream, not fromNotificationProjectionService. That path is not filtered by this setting. Keep the UI helper text accurate ("Inbox and push notifications") so the scope is not overstated. A follow-up can plumb the repository filter into the desktop adapter. - No new database migration.
Created by ProPR AI Planner
Activity
propr-dev commentedon Sep 22, 2026
Suggested Implementation:
Implementation Approach
Why this shape. The setting is stored as one more optional boolean on the existing monitored-repository configuration object rather than in a new table. That configuration is already a JSON document in
system_configs, already has two precedents for the exact same pattern (autoFollowupOnFailedCi,visualPreview), and already flows through the API, the instance catalog, the CLI and the MCP management tools. Reusing it means zero migrations, automatic propagation to every client, and a UI change that is a copy of code the team already reviews.Why filter in
NotificationProjectionServiceand nowhere else. That service is the single producer of repository-scoped lifecycle notifications (plan/task/review/pull_request/indexing). Filtering at that one choke point guarantees the promise in the issue — no notification is generated — without having to audit every call site that publishes a lifecycle event. It also automatically suppresses Web Push, because push delivery jobs are only fanned out when a notification event is created.Alternatives considered and rejected:
repository_notification_settingstable. Rejected: a migration, a second source of truth for repository settings, and a second write path to keep in sync withPOST /api/config/repos.Why a locally cached, injected-connection lookup. The projection service runs in a dedicated worker thread against a
createBackgroundDatabaseconnection whosebusy_timeoutis0specifically so SQLite contention fails fast instead of blocking. Calling@propr/core's config manager from there would open the module-singleton connection with default blocking semantics and reintroduce the stalls thatnotificationBackgroundServicewas built to avoid. So the service readssystem_configsthrough its own injectedKnex, caches the result for a few seconds, and fails open on error.Why the value is shared across branch entries.
autoFollowupOnFailedCiandvisualPrevieware already unified across branch entries bybuildRepositoriesForDisplay, and users think in terms of repositories, notrepo@branchrows. Making notifications per-branch would be a surprising, unrequested distinction.1. Core type
File:
packages/core/src/config/configManager.tsWhy this file:
RepoToMonitoris the shared shape used by the API validator, the daemon config loader, the CLI and the MCP tools. Adding the field here is what makes every downstream consumer type-check.Find the
RepoToMonitorinterface (search forautoFollowupOnFailedCito locate it) and add the new optional field.export interface RepoToMonitor { id?: string; name: string; enabled: boolean; alias?: string; baseBranch?: string; autoFollowupOnFailedCi?: boolean; + // Optional so every configuration written before this feature keeps working: + // `undefined` must be read as "enabled", which is also the product default. + // A non-optional field would force a data backfill we deliberately avoid. + notificationsEnabled?: boolean; visualPreview?: RepoVisualPreviewSettings; }2. API validation and persistence
File:
packages/api/routes/configRepoValidation.tsWhy this file:
normalizeRepoConfigis the trust boundary for everything written torepos_to_monitor. Validating here means the CLI, the Web UI and the MCPupdate_repository_configurationtool all get the same guarantees, and the stored document can never contain a non-boolean in this field.Add the normalization inside
normalizeRepoConfig, right next to whereautoFollowupOnFailedCiis handled, and add apreserveRepoNotificationshelper next topreserveRepoAutoFollowup. Match the exact signature of the existingpreserveRepoAutoFollowuphelper — the snippet below shows the intent, not necessarily the literal parameter list in your working copy.File:
packages/api/routes/configRoutes.tsWhy this file: this is where the preserve helpers are actually applied before persistence. Skipping it would make the validator's preservation logic dead code.
Locate the block that calls
preserveRepoAutoFollowup/preserveRepoVisualPreviewwhile building the list to persist, and add the new helper to the same pipeline.const normalized = submittedRepos.map((submitted, index) => { const repo = normalizeRepoConfig(submitted, index); const withFollowup = preserveRepoAutoFollowup(repo, submitted, storedFollowupByRepository); - return preserveRepoVisualPreview(withFollowup, submitted, storedPreviewByRepository); + const withNotifications = preserveRepoNotifications( + withFollowup, + submitted as Record<string, unknown>, + storedNotificationsByRepository, + ); + return preserveRepoVisualPreview(withNotifications, submitted, storedPreviewByRepository); });Build
storedNotificationsByRepositorythe same way the existing stored-value maps are built from the currently persisted configuration (lower-cased repository name → boolean, using the resolution rule:falseonly when every stored entry for that name is explicitlyfalse).3. The notification filter
File:
packages/api/services/notificationProjectionService.tsWhy this file: this is the single producer of repository-scoped notification events. Every guard added here is one the rest of the system inherits for free, including Web Push, because push delivery jobs are only created as a side effect of
createNotificationEvent.3a. Constants and options
export interface NotificationProjectionOptions { database: Knex; notificationService?: NotificationEventWriter; now?: () => Date; stalledAfterMs?: number; stalledCheckIntervalMs?: number; logger?: ProjectionLogger; contentionRetryDelaysMs?: readonly number[]; + /** + * Test seam. Production leaves this undefined and uses the cached + * system_configs reader below, so the real read path is exercised by the + * integration tests that seed the configuration row directly. + */ + repositoryNotificationsEnabled?: (repository: string) => Promise<boolean>; }3b. The cached, fail-open lookup
Add these fields and methods to the
NotificationProjectionServiceclass (private members go next to the existingstalledTimerfield; the methods next to the other private helpers).In the constructor:
this.contentionRetryDelaysMs = options.contentionRetryDelaysMs ?? SQLITE_CONTENTION_RETRY_DELAYS_MS; + this.repositoryNotificationsEnabled = options.repositoryNotificationsEnabled;3c. Guards on every repository-scoped projection
Plans. The payload has no repository, so the guard must run after the draft row is loaded.
Tasks. The
notification_source_activityupsert is deliberately left running. Those rows are the bookkeeping that drives stalled detection and resolution cleanup; skipping them would leave a repository's activity rows permanently non-terminal if the setting were toggled mid-flight, producing a spurious stalled card later.Indexing.
if (!accepted || payload.phase !== 'failed') return; + if (!await this.notificationsEnabledFor(payload.repository)) return; const recipients = await this.loadAdministratorRecipients();Stalled sweep. The sweep reads rows that may have been recorded before the setting changed, so it needs its own guard.
for (const row of rows) { + // Rows can predate the operator disabling notifications for this + // repository, so re-check rather than relying on the producer guards. + if (!await this.notificationsEnabledFor(row.repository)) continue; const metadata = sourceMetadata(row);projectSystemSnapshotis intentionally untouched.system_failurenotifications target a component, not a repository, and are the operator's only signal that the instance itself is unhealthy.4. Web UI
File:
propr-ui/src/api/proprTypes.tsWhy this file:
MonitoredRepois the contract every repository component reads. Without this, the settings bar and the management hook will not type-check.export interface MonitoredRepo { id: string; name: string; enabled: boolean; alias?: string; baseBranch?: string; autoFollowupOnFailedCi?: boolean; + /** Undefined means enabled: the product default, and the legacy behaviour. */ + notificationsEnabled?: boolean; starred?: boolean; hidden?: boolean; visualPreview?: { ... }; }File:
propr-ui/src/hooks/repositoryVisualPreview.tsWhy this file: this module already owns the "one repository, many branch entries" merge rules used by
buildRepositoriesForDisplay. Putting the notification rule anywhere else would let the displayed state drift from the displayed visual-preview and auto-CI state.Then, inside
buildRepositoriesForDisplay, unify the field exactly asautoFollowupOnFailedCiandvisualPrevieware unified today:return repos.map(repo => { const key = getRepositoryConfigKey(repo.name); return { ...repo, autoFollowupOnFailedCi: /* existing unification */, + // Displayed state must match what the toggle will write, otherwise the + // checkbox appears to "bounce back" after a save on multi-branch repos. + notificationsEnabled: resolveRepositoryNotificationsEnabled(repos, key), visualPreview: /* existing unification */, }; });File:
propr-ui/src/hooks/useRepositoryManagement.tsWhy this file: this hook owns loading, optimistic state and auto-save for repository configuration. Everything the settings bar renders comes from here.
Parsing — both branches of
loadRepos(the admingetRepoConfigpath and the membergetInstanceCatalogpath go through the same mapper):.map((repo: unknown): Repo | null => { if (typeof repo === 'string') { const userPref = prefs[repo] || {}; - return { id: generateId(), name: repo, enabled: true, autoFollowupOnFailedCi: false, visualPreview: defaultVisualPreview(), starred: userPref.starred, hidden: userPref.hidden }; + // Legacy string entries predate every per-repository option, so + // they must read as the default: notifications on. + return { id: generateId(), name: repo, enabled: true, autoFollowupOnFailedCi: false, notificationsEnabled: true, visualPreview: defaultVisualPreview(), starred: userPref.starred, hidden: userPref.hidden }; } else if (repo && typeof repo === 'object') { const repoObj = repo as Record<string, unknown>; const name = (repoObj.name as string) || (repoObj.full_name as string); const enabled = typeof repoObj.enabled === 'boolean' ? repoObj.enabled : true; const autoFollowupOnFailedCi = repoObj.autoFollowupOnFailedCi === true; + // `!== false` rather than `=== true`: an absent field is enabled. + // Using `=== true` here would silence every pre-existing repository. + const notificationsEnabled = repoObj.notificationsEnabled !== false; const visualPreview = parseVisualPreview(repoObj.visualPreview); ... if (name) { - return { id, name, enabled, autoFollowupOnFailedCi, visualPreview, alias, baseBranch, starred: userPref.starred, hidden: userPref.hidden }; + return { id, name, enabled, autoFollowupOnFailedCi, notificationsEnabled, visualPreview, alias, baseBranch, starred: userPref.starred, hidden: userPref.hidden }; } } return null; })Toggle handler — placed next to
handleToggleAutoCiFollowup:Import
resolveRepositoryNotificationsEnabledfrom./repositoryVisualPreview, addhandleToggleNotifications: (repoId: string) => void;toUseRepositoryManagementResult, and include it in the returned object.handleAddRepokeeps the modal untouched but must still persist the default explicitly, so the stored document is self-describing:const newEntry: Repo = { id: generateId(), name: newRepo, enabled: true, autoFollowupOnFailedCi, + // Not surfaced in the Add Repository modal by design (see the issue); + // written explicitly so GET /api/config/repos is unambiguous. + notificationsEnabled: true, visualPreview, alias: newAlias.trim() || undefined, baseBranch: newBaseBranch.trim() || undefined };File:
propr-ui/src/components/RepositorySettingsBar.tsxWhy this file: this renders the Settings tab content for the selected repository. The toggle is placed in its own
Notificationsgroup rather than insideAutomation, because the wholeAutomationblock is hidden for read-only users while this control must stay visible-but-disabled (consistent withMonitor repository,Star, andHide).Insert the new section immediately after the closing
</div>of theRepositorygroup and before theAutomationblock:</label> </div> + <div className="mt-8 border-t border-slate-200 pt-6"> + <h3 className="mb-2 text-[10px] uppercase font-bold tracking-widest text-slate-500">Notifications</h3> + <label className="flex items-center justify-between gap-4 py-2 text-xs text-slate-600"> + <span className="min-w-0"> + <span className="block">Notifications</span> + {/* The copy names the exact surfaces this filter covers. Desktop + native task alerts come from the live socket stream and are + explicitly out of scope, so they are not promised here. */} + <span className="mt-1 block text-slate-500"> + Generate Inbox and push notifications for this repository. Turning this off silences + plan, task, review, pull request, and indexing notifications without changing automation. + </span> + </span> + <input + type="checkbox" + checked={repo.notificationsEnabled !== false} + onChange={() => onToggleNotifications(repo.id)} + disabled={isReadOnly} + aria-label={`Notifications for ${repo.name}`} + className="sr-only peer" + /> + <span className={toggleClassName} /> + </label> + </div> + {!isReadOnly && ( <div className="mt-8 border-t border-slate-200 pt-6"> <h3 className="mb-2 text-[10px] uppercase font-bold tracking-widest text-slate-500">Automation</h3>File:
propr-ui/src/pages/RepositoriesPage.tsxWhy this file: it builds
settingsContentand is the only place that wires hook handlers into the settings bar.const { repos, loading, error, availableRepos, indexingStatuses, saveStatus, showHiddenRepos, filteredRepos, hiddenCount, handleStopIndexing, handleReindexRepo, handleAddRepo, handleRemoveRepo, handleToggleRepo, handleToggleStar, handleToggleHidden, - handleToggleAutoCiFollowup, handleUpdateVisualPreview, + handleToggleAutoCiFollowup, handleToggleNotifications, handleUpdateVisualPreview, handleToggleShowHidden, handleRetry } = useRepositoryManagement();onToggleAutoCiFollowup={handleToggleAutoCiFollowup} + onToggleNotifications={handleToggleNotifications} onUpdateVisualPreview={handleUpdateVisualPreview}5. CLI
File:
packages/cli/src/api/repos.tsWhy this file:
addRepo/updateRepore-submit the whole repository list. If they drop the new field, apropr repo togglewould silently re-enable notifications a user turned off in the UI — the same class of bugpreserveRepoNotificationsguards against server-side.export interface Repository { id?: string; name: string; enabled: boolean; alias?: string; baseBranch?: string; autoFollowupOnFailedCi?: boolean; + notificationsEnabled?: boolean; visualPreview?: RepositoryVisualPreview; }const newRepo: Repository = { name, enabled: true, autoFollowupOnFailedCi: options.autoFollowupOnFailedCi ?? false, + // Explicit rather than omitted so the persisted document states the + // product default instead of relying on every reader's fallback. + notificationsEnabled: options.notificationsEnabled ?? true, ... };In
updateRepo, mergenotificationsEnabledalongside the other optional fields: apply it only when the caller supplied it, so unrelated updates preserve the stored value.File:
packages/cli/src/commands/repoCommands.tsrepo.command('add <repository>') .option('--alias <alias>', 'Friendly name for this repository') .option('--base-branch <branch>', 'Branch to monitor') .option('--auto-followup-on-failed-ci', 'Send an automatic follow-up when CI fails', false) + // Commander turns `--no-notifications` into `options.notifications === false`, + // which expresses "on by default, opt out" without an extra boolean parser. + .option('--no-notifications', 'Do not generate Inbox or push notifications for this repository')In the action handler pass
notificationsEnabled: options.notifications !== false, and add aNotificationscolumn todisplayReposTablerenderingOn/Offfromrepo.notificationsEnabled !== false.6. Tests
These are the regressions that matter. Add each one to the file named.
packages/api/test/configRepoValidation.test.tspackages/api/test/configRepoRoutes.test.tsGETreturnsnotificationsEnabled: truefor a stored entry that omits the field.POSTwithnotificationsEnabled: falseon one branch entry persistsfalseon every entry of that repository name and leaves other repositories untouched.POSTfrom a client that omits the field preserves a storedfalse(coverspreserveRepoNotifications).packages/api/test/notificationProjectionService.test.tsUse the existing harness and seed the configuration row before projecting:
propr-ui/src/hooks/useRepositoryManagement.test.tsxpropr-ui/e2e/repositories-settings.pw.tsNotificationswritesnotificationsEnabled: falseto both branch entries.await expect(page.getByRole('checkbox', { name: 'Notifications for integry/propr', exact: true })).toBeDisabled();— note the existing/Automatic CI follow-up|Visual previews/count assertion stays valid because the new control has a distinct accessible name.7. Documentation
CHANGELOG.md: add anAddedentry under Unreleased describing the per-repository notification filter and its default-on behaviour.packages/api/README.md(Web Push section): note that repository-scoped notifications are additionally gated by the repository'snotificationsEnabledsetting, and thatsystem_failurenotifications are not.propr-dev commentedon Sep 22, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-52457/claude-opus-5-add-a-per-repository-noti-20260922-0837-1wbmainissue-2457-20260922-0837-claude-opus-5-1wb🔍 Track Task Execution