Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds a new data edit command alongside refactored initialization logic, enabling users to selectively edit parts of the invoice data with existing values prefilled.
- Refactor
init/editflows into a sharedinput_data_atfunction accepting defaults. - Introduce
DataSelectorto allow editing all or specific sections (vendor,client, etc.). - Update CLI TUI inputs to use existing data as defaults and wire up
data editin dispatch and README.
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/core/src/models/year_and_month.rs | Removed obsolete month_year method |
| crates/core/src/models/month.rs | Dropped name method in localization refactor |
| crates/core/src/models/font_weight.rs | Added FontWeight enum |
| crates/core/src/models/data/data.rs | Derived WithSetters and added setter for client field |
| crates/core/src/logic/read_write_data/read_data_from_disk.rs | Renamed data_dir to data_dir_create_if and added non-creating alias |
| crates/core/src/logic/command.rs | Extracted input_data_at; added init_data_at, edit_data_at, DataSelector |
| crates/cli/src/input/tui.rs | Updated prompts to use defaults; added WithDefaultMaybe trait |
| crates/cli/src/input/get_input.rs | Added EditDataInput and mapped to DataSelector |
| crates/cli/src/dispatch_command.rs | Connected data edit via curry helper |
| crates/cli/src/README.md | Documented new data edit usage and updated description |
| .release.toml | Added workspace release configuration |
| .envrc | Sourced secret file before exporting RUST_LOG |
Comments suppressed due to low confidence (5)
crates/core/src/logic/read_write_data/read_data_from_disk.rs:27
- Update the panic message to reflect the actual function and include the failing path, e.g.:
expect(format!("Unable to create data directory at {}", dir.display())).
.expect("Should be able to create directory at data_dir()/klirr/data");
crates/core/src/logic/read_write_data/read_data_from_disk.rs:20
- Add unit tests for
data_dir_create_if(true)anddata_dir_create_if(false)to verify directory creation and non-creation behavior.
pub fn data_dir_create_if(create_if_not_exists: bool) -> PathBuf {
crates/core/src/logic/command.rs:4
- Add a doc comment explaining the purpose, parameters, and expected behavior of
input_data_atfor better maintainability.
fn input_data_at(
crates/core/src/logic/command.rs:38
- Provide a doc comment for
edit_data_at, outlining its role, arguments, and side effects to aid future readers.
pub fn edit_data_at(
crates/cli/src/input/tui.rs:55
- [nitpick] The trait name
WithDefaultMaybeis somewhat vague; consider renaming toWithOptionalDefaultor similar to clearly convey its purpose.
trait WithDefaultMaybe<'o, T> {
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
==========================================
+ Coverage 96.45% 97.25% +0.80%
==========================================
Files 59 59
Lines 1296 1312 +16
==========================================
+ Hits 1250 1276 +26
+ Misses 46 36 -10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add new feature, a command to edit the data. the
data initanddata editcommands share the same underlying flow, now upgraded to usedata: Data(Data::sample()forinit).Use can select which part of the data to edit,
allor justvendoror justclientetc.Also add a
.release.tomlto use withcargo-release(not tried yet)`.