feat(ext/sw): get_field_history handler

Decrypts item and calls WASM get_field_history to extract tracked
field history for the popup's history view.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-04-26 17:49:59 -04:00
parent d2cb6d8461
commit 39a8e12438

View File

@@ -346,9 +346,13 @@ export async function handle(
return { ok: true, data: result }; return { ok: true, data: result };
} }
// Handler for this case is added in Task 5. case 'get_field_history': {
case 'get_field_history': const handle = session.getCurrent();
return { ok: false, error: 'not_implemented' }; if (!handle || !state.gitHost) return { ok: false, error: 'vault_locked' };
const item = await vault.fetchAndDecryptItem(state.gitHost, handle, msg.id);
const history = state.wasm.get_field_history(JSON.stringify(item));
return { ok: true, data: { history } };
}
} }
} }