Implement the in-process structured entry editor

Closes #21
This commit is contained in:
Hermes Agent
2026-08-10 07:22:55 +00:00
parent cf7a6216ac
commit b503de8b2e
14 changed files with 1547 additions and 37 deletions

View File

@@ -32,6 +32,10 @@ impl EntryViewer {
&self.document
}
pub fn into_document(self) -> EntryDocument {
self.document
}
pub fn focused_index(&self) -> Option<usize> {
(!self.document.fields().is_empty()).then_some(self.focused)
}
@@ -120,7 +124,7 @@ impl fmt::Debug for EntryViewer {
#[cfg(test)]
pub(crate) mod test_support {
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use ironstorage::{
crypto::{KeyInfo, KeyStore, SecretProvider, SecretProviderError},
@@ -144,7 +148,13 @@ pub(crate) mod test_support {
pub(crate) fn fixture_document(entry: &str) -> EntryDocument {
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../../crates/storage/tests/fixtures/compatibility");
let repository = Repository::open(root.join("stores/basic")).expect("fixture repository");
fixture_document_from(&root.join("stores/basic"), entry)
}
pub(crate) fn fixture_document_from(store: &Path, entry: &str) -> EntryDocument {
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../../crates/storage/tests/fixtures/compatibility");
let repository = Repository::open(store).expect("fixture repository");
let keys = KeyStore::load(root.join("keys")).expect("fixture keys");
EntryDocumentService::new(&repository, &keys)
.open(entry, &mut FixtureSecrets)