feat(android): show attachments, without carrying their bytes

One attachment took the cache from 13 to 174 KB: the content travels base64 in the snapshot and is decrypted in memory with the rest. TVault reads name, type and size and DROPS content_b64 - holding it for the whole vault while nothing displays it would be paying for nothing.

The detail now says a document exists. Saving it is what remains, and what blocks that is not code but where a file lands on Android 10+. When that is settled, the content re-reads from the raw JSON.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-08-15 15:05:08 +01:00
parent 7939d268f3
commit 7229028060
3 changed files with 71 additions and 7 deletions
+17
View File
@@ -516,6 +516,16 @@ begin
OnSearchChanged(nil);
end;
function HumanSize(ABytes: Int64): string;
begin
if ABytes >= 1024 * 1024 then
Result := Format('%.1f Mo', [ABytes / (1024 * 1024)])
else if ABytes >= 1024 then
Result := Format('%.0f Ko', [ABytes / 1024])
else
Result := Format('%d o', [ABytes]);
end;
procedure TForm8.ClearDetailRows;
var
LRow: TLayout;
@@ -573,6 +583,13 @@ begin
if LMeta <> '' then LMeta := LMeta + ' - ';
LMeta := LMeta + FCurrent.Tags;
end;
// Les pieces jointes ne sont pas encore enregistrables sur le telephone,
// mais taire leur existence serait pire : on saurait sur le poste qu'une
// entree porte un document, et pas ici.
for I := 0 to High(FCurrent.Attachments) do
Add('Piece jointe', FCurrent.Attachments[I].FileName + ' ' +
HumanSize(FCurrent.Attachments[I].SizeBytes), False);
Add('Dossier / etiquettes', LMeta, False);
// Le sous-type n'existe que pour les modeles (carte, cle SSH, serveur...) ;
// Add ignore une valeur vide, donc rien a tester ici.