Author filter chips composable with repo/unread filters; 'mine' pinned first
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgBEW6qAwgn2fcQbA2f4ZQ
This commit is contained in:
co-authored by
Claude Fable 5
parent
2015d20aa5
commit
5aa6f3367d
+1
-1
@@ -40,7 +40,7 @@ function scheduleNext(): void {
|
||||
}, intervalMs);
|
||||
}
|
||||
|
||||
const app = createApp({ db, triggerSync: poll });
|
||||
const app = createApp({ db, user: config.user, triggerSync: poll });
|
||||
app.listen(config.port, config.host, () => {
|
||||
console.log(`pr-monitor listening on http://${config.host}:${config.port}`);
|
||||
});
|
||||
|
||||
+3
-1
@@ -9,6 +9,7 @@ import { buildFailureReport } from './failures.js';
|
||||
|
||||
export interface RouteDeps {
|
||||
db: Db;
|
||||
user: string;
|
||||
triggerSync: () => Promise<void>;
|
||||
}
|
||||
|
||||
@@ -22,13 +23,14 @@ export function buildSyncPayload(db: Db, changedPrIds: string[] = [], newEventCo
|
||||
};
|
||||
}
|
||||
|
||||
export function createApp({ db, triggerSync }: RouteDeps): Express {
|
||||
export function createApp({ db, user, triggerSync }: RouteDeps): Express {
|
||||
const app = express();
|
||||
app.use(express.json());
|
||||
|
||||
app.get('/api/state', (_req, res) => {
|
||||
const { byPr, total } = db.unreadCounts();
|
||||
const payload: StatePayload = {
|
||||
user,
|
||||
prs: db.getOpenSnapshots(),
|
||||
lastSyncAt: db.getMeta('last_sync_at'),
|
||||
lastSyncError: db.getMeta('last_sync_error'),
|
||||
|
||||
Reference in New Issue
Block a user