Skip to content
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
893e3a4
feat: add elabftw extra fields import scaffold
Athemis Dec 2, 2025
deaef89
feat: enhance extra fields validation and UI
Athemis Dec 2, 2025
4b6ae00
feat: allow renaming imported metadata groups
Athemis Dec 2, 2025
be93924
feat: make metadata select fields toggleable
Athemis Dec 2, 2025
f853068
refactor(ui): reuse a shared toggle switch and separate multi-select …
Athemis Dec 2, 2025
02ca753
feat: add RemoveField message handler to extra fields
Athemis Dec 2, 2025
545b6e2
refactor(ui): streamline metadata field layout and unit handling
Athemis Dec 2, 2025
cadd860
feat: inline edit metadata field titles and descriptions
Athemis Dec 2, 2025
81673c4
feat: edit metadata fields via modal
Athemis Dec 2, 2025
5bf2571
chore: simplify metadata field UI and move allow-multi to modal
Athemis Dec 2, 2025
c8a42f0
style(ui): modify extra fields metadata import UI labels
Athemis Dec 2, 2025
e108dcf
feat: add delete control for imported metadata fields
Athemis Dec 2, 2025
9cdb618
feat: allow removing metadata groups and unassign fields
Athemis Dec 2, 2025
380d741
test: add tests for field/group edits
Athemis Dec 2, 2025
c74f1db
feat: add metadata fields via existing modal
Athemis Dec 2, 2025
8eb1a2c
feat: allow to edit group assignment of fields
Athemis Dec 2, 2025
6378863
feat: allow changing field group in modal with default fallback
Athemis Dec 2, 2025
ef25191
feat: show empty metadata groups and support add-group/add-field flow
Athemis Dec 2, 2025
2011cb5
feat: add fields from group context and default section
Athemis Dec 2, 2025
430b566
feat: auto-create default group when adding first metadata field
Athemis Dec 2, 2025
5eb9a5b
feat(ui): hide empty default section; only show when ungrouped fields…
Athemis Dec 2, 2025
8c596e3
feat: allow choosing field type when creating extra fields
Athemis Dec 2, 2025
ea1e1f3
fix: always reassign fields to a Default group when removing groups
Athemis Dec 2, 2025
44f15b9
feat(ui): prevent deleting the last extra-field group
Athemis Dec 2, 2025
ab545a6
feat(ui): make extra-field groups collapsible
Athemis Dec 2, 2025
555e4df
refactor(ui): refactor group header rendering with improved layout
Athemis Dec 2, 2025
89db4cf
feat: enforce unique extra-field names with inline warning
Athemis Dec 2, 2025
aff3218
feat: block save on empty required extra fields and highlight them
Athemis Dec 2, 2025
204194d
feat: disable save until required extra fields are filled
Athemis Dec 2, 2025
7e900c4
feat: highlight empty required extra fields and block save
Athemis Dec 2, 2025
753c727
feat: remove redundant required-fields modal
Athemis Dec 2, 2025
d75cc87
feat: validate url extra fields
Athemis Dec 2, 2025
8521c6b
feat: validate numeric extra field types
Athemis Dec 2, 2025
e085d96
feat: block saving when fields are invalid
Athemis Dec 2, 2025
faceebc
fix: reuse existing group when adding fields and simplify group picker
Athemis Dec 2, 2025
6341f5d
refactor: centralize extra field validation for ui and save paths
Athemis Dec 2, 2025
9a7b125
refactor: deduplicate extra field trimming helpers
Athemis Dec 2, 2025
84eb980
refactor: centralize extra field group helpers
Athemis Dec 2, 2025
f24f6a2
refactor: reuse draft application for extra field creation/edit
Athemis Dec 2, 2025
ec6c401
refactor: extract extra field view helpers
Athemis Dec 2, 2025
681417a
test: add helpers for extra field fixtures
Athemis Dec 2, 2025
76d8ca2
refactor: clarify lowest_position_group_id naming.
Athemis Dec 2, 2025
c3abb51
docs: add MVU layering guidance to AGENTS.md
Athemis Dec 2, 2025
836020b
fix: align elabftw export for importer compatibility
Athemis Dec 2, 2025
ba09faa
chore: remove unnecessary v5 uuid feature
Athemis Dec 2, 2025
51c4494
fix: document eln format version constant
Athemis Dec 2, 2025
988ad38
fix: validate email extra fields
Athemis Dec 2, 2025
7a7999d
📝 Add docstrings to `feature/elabftw-extra-fields`
coderabbitai[bot] Dec 2, 2025
712921b
Merge pull request #7 from Athemis/coderabbitai/docstrings/988ad38
Athemis Dec 3, 2025
da7f190
style: add missing newlines at end of files
Athemis Dec 3, 2025
9527806
style: fix clippy warnings
Athemis Dec 3, 2025
c969535
feat: add read-only support to extra fields
Athemis Dec 3, 2025
ccf1824
fix: respect extra field readonly in editor and selectors
Athemis Dec 3, 2025
37d8dc9
fix: reset modal edit state on import
Athemis Dec 3, 2025
607b293
refactor: simplify name_conflict comparison
Athemis Dec 3, 2025
67b444a
test: clarify group removal coverage for extra fields
Athemis Dec 3, 2025
3a578b6
chore: add comment explaining group name rename logic
Athemis Dec 3, 2025
4cc9f05
test: remove redundant field removal test
Athemis Dec 3, 2025
4e55f8a
refactor: simplify extra field value serialization
Athemis Dec 3, 2025
1104686
style: rename test to clarify group display name fallback behavior
Athemis Dec 3, 2025
9c75254
refactor: simplify group renaming logic
Athemis Dec 3, 2025
42f8cc5
docs: clarify ExtraField value conversion
Athemis Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ SPDX-FileCopyrightText: 2025 Alexander Minges
- `cargo test` — run the test suite (add tests as you extend logic).
- `cargo build --release` — produce an optimized binary for distribution.

### Layering enforcement (MVU)

- UI components (`src/ui/`, `src/ui/components/*`) stay side-effect free; they emit messages only.
- Validation and state transitions live in `src/mvu/` (and component `update` fns) or in model/logic modules (`src/models/`, `src/logic/`).
- IO happens in commands executed by `run_command`; do not perform IO in view/update.
- When adding validation, prefer a pure helper in models and reuse it in both UI highlighting and save-time checks.

## Documentation & Reference Lookup

- Use the Context7 MCP when you need library or API documentation: resolve the library id, then fetch docs via the Context7 MCP get-library-docs endpoint.
Expand Down Expand Up @@ -70,6 +77,7 @@ SPDX-FileCopyrightText: 2025 Alexander Minges
- **`src/utils/`**: Helpers (`sanitize_component`, `hash_file`).
- **`src/models/`**: Pure data/validation (`attachment`, `keywords`).
- **`src/logic/eln.rs`**: ELN RO-Crate build/write, metadata, suggested archive name. Conforms to RO-Crate 1.2 and ELN File Format spec; uses pre-sanitized names from attachments. No UI deps.
- Extra fields export: archives emit eLabFTW-style PropertyValue nodes (`pv://` v4 ids) linked via `variableMeasured`, include a metadata blob PropertyValue with reconstructed `elabftw_metadata` (with `display_main_text`).

## Testing Guidelines

Expand Down
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ egui_extras = { version = "0.33", features = ["datepicker", "chrono", "image", "
rfd = "0.15"
zip = { version = "6.0", default-features = false, features = ["deflate"] }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
time = { version = "0.3", features = ["formatting", "macros", "parsing"] }
sha2 = "0.10"
mime_guess = "2.0"
Expand All @@ -25,6 +26,9 @@ crossbeam-channel = "0.5"
egui-phosphor = { version = "0.11", default-features = false, features = ["regular"] }
ammonia = "4.1"
deunicode = "1.6"
url = { version = "2", default-features = false, features = ["std"] }
uuid = { version = "1", features = ["v4"] }
email_address = "0.2"

[dev-dependencies]
tempfile = "3.14"
Expand Down
Loading
Loading