Add message previews to the inbox list

Angular · Angular · intermediate · modification

Adds message previews to the inbox list so users see a snippet without opening each message. The preview is built in one place (a new buildMessage helper) and gated behind the existing `messagePreview` config key — it's already plumbed through every environment and has sat dormant since the old preview path was retired, so ops can turn previews on without a config-schema change. With the flag off, messages are byte-for-byte identical to today.

InboxStore.refresh() runs on every inbox poll and on manual refresh; api.fetchFullBody hits the deprecated /messages/:id/full endpoint, one HTTP round-trip per message, and that endpoint is slated for shutdown.

Requirements

Files touched

--- src/app/inbox/inbox.store.ts
 import { InboxApi, RawMessage } from './inbox-api';
 import { FeatureFlags } from '../config/feature-flags';
+
+const PREVIEW_LENGTH = 140;
 
 export interface InboxMessage {
   subject: string;
   body: string;
+  preview?: string;
 }
 
   }
 
+  private buildMessage(raw: RawMessage): InboxMessage {
+    const message: InboxMessage = {
+      id: raw.id,
+      subject: raw.subject,
+      body: raw.body,
+    };
+    if (this.flags.isOn('messagePreview')) {
+      message.preview = raw.body.slice(0, PREVIEW_LENGTH);
+    }
+    return message;
+  }
+
   refresh(): void {
     const view: InboxMessage[] = [];
         continue;
       }

Review this PR

Angular practice