Objective
Remove thumbnail generation from SwiftUI render paths.
Scope
In scope: attachment thumbnail lifecycle and preview rendering.
Out of scope: upload format/size policy changes.
Target Files
- Agmente/ImageAttachment.swift
- Agmente/SessionDetailView.swift
Problem
Thumbnail rendering is performed from view code, which can repeat UIKit drawing during recomposition.
Evidence
- Agmente/SessionDetailView.swift:570
- Agmente/ImageAttachment.swift:32
Proposed Changes
- Generate thumbnail once when attachment is created/added.
- Store and reuse precomputed thumbnail in attachment model.
- Update preview views to consume cached thumbnails only.
Acceptance Criteria
- No repeated thumbnail generation during normal UI redraws.
- Thumbnail quality/size remains acceptable in composer and chat views.
- Existing tests pass.
Validation Plan
- Attach multiple photos and type/scroll; verify responsiveness.
- Confirm thumbnails appear correctly after reopen/restore flows.
Risks
Higher attachment memory use.
Mitigation: keep bounded thumbnail size and avoid storing unnecessary variants.
Objective
Remove thumbnail generation from SwiftUI render paths.
Scope
In scope: attachment thumbnail lifecycle and preview rendering.
Out of scope: upload format/size policy changes.
Target Files
Problem
Thumbnail rendering is performed from view code, which can repeat UIKit drawing during recomposition.
Evidence
Proposed Changes
Acceptance Criteria
Validation Plan
Risks
Higher attachment memory use.
Mitigation: keep bounded thumbnail size and avoid storing unnecessary variants.