fix: keep suppressed notification names readable (#73)
Co-authored-by: Codex <codex@pikas.tech>
This commit is contained in:
@@ -653,15 +653,17 @@ function suppressedNotificationEvents(summary: SuppressedNotificationSummary): B
|
||||
payload: {
|
||||
phase: "codex-app-server-notifications-suppressed",
|
||||
total: summary.total,
|
||||
byMethod: sortCountRecord(summary.byMethod),
|
||||
byItemType: sortCountRecord(summary.byItemType),
|
||||
methods: countRecordEntries(summary.byMethod, "method"),
|
||||
itemTypes: countRecordEntries(summary.byItemType, "itemType"),
|
||||
valuesPrinted: false,
|
||||
},
|
||||
}];
|
||||
}
|
||||
|
||||
function sortCountRecord(input: Record<string, number>): JsonRecord {
|
||||
return Object.fromEntries(Object.entries(input).sort(([left], [right]) => left.localeCompare(right))) as JsonRecord;
|
||||
function countRecordEntries(input: Record<string, number>, keyName: "method" | "itemType"): JsonRecord[] {
|
||||
return Object.entries(input)
|
||||
.sort(([left], [right]) => left.localeCompare(right))
|
||||
.map(([name, count]) => ({ [keyName]: name, count }) as JsonRecord);
|
||||
}
|
||||
|
||||
function isSuppressedCodexStatusNotification(method: string): boolean {
|
||||
|
||||
Reference in New Issue
Block a user