feat(frontend): newest emails first, mailbox above the SES tools
CI / checks (pull_request) Failing after 12m24s

This commit is contained in:
Zakaria
2026-10-24 02:01:14 -04:00
parent 18c1f5067f
commit ce444f0851
5 changed files with 23 additions and 3 deletions
@@ -47,7 +47,7 @@ export class AwsSesAdapter implements CloudServiceAdapter {
async list(query: ResourceQuery = {}): Promise<CloudResource[]> {
const messages = await this.fetchInbox()
const resources = messages.map(messageToResource)
const resources = messages.map(messageToResource).sort(newestFirst)
return filterBySearch(resources, query.search)
}
@@ -137,6 +137,10 @@ function findCode(body: string | null | undefined): string | null {
return body?.match(CODE_PATTERN)?.[1] ?? null
}
function newestFirst(a: CloudResource, b: CloudResource): number {
return (b.createdAt ?? '').localeCompare(a.createdAt ?? '')
}
function filterBySearch(resources: CloudResource[], search?: string): CloudResource[] {
const normalized = search?.trim().toLowerCase()
if (!normalized) return resources