Repository navigation
chore(deps): cooklang 0.22.0; keep free-hand names starting with #, ~ or @ - #861
Merged
Merged
Conversation
…klang-language-server to 0.6.0 Also cooklang-ingredient-parser to 0.22.0. cooklang 0.22 reads a shopping list item's quantity as a `Quantity` instead of a string. CookCLI's `FreeHandItem` and `OptionalSelection` keep the stored string form (`2%l`) as their JSON shape and convert at the store boundary: written back with `Quantity::to_cooklang`, read with the shopping list format's own quantity grammar. Lines are matched by the quantity they read as, so a rewrite stores the format's spelling (`0.50%kg` becomes `0.5%kg`). Claude-Session: https://claude.ai/code/session_01B7jPFN3aqqHBFR4HAZyuqW
A free-hand item went onto the generated list by being written as a
one-ingredient recipe (`@{name}{{q}}`) and parsed, so a name such as
`#1 flour`, `~ramen` or `@milk` came out as cookware, a timer or a
stripped name, and its tick was dropped on the next compaction.
Free-hand items now join the list through cooklang 0.22's
`IngredientList::add_shopping_item`, under their own name, both on the
page (`POST /api/shopping_list`, which still refuses a blank name with
400) and when the server works out which ticks to keep. The CLI's
`--extra` reads its value as a one-line shopping list, dropping one
leading `@` as before; a value that is not one named item (empty,
unclosed braces, a recipe line, several lines) is still a parse error
naming it.
Claude-Session: https://claude.ai/code/session_01B7jPFN3aqqHBFR4HAZyuqW
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cooklang0.21.0 → 0.22.0,cooklang-ingredient-parser0.21.0 → 0.22.0,cooklang-reports0.9.0 → 0.10.0,cooklang-language-server0.5.0 → 0.6.0. The tree keeps a singlecooklang.IngredientItem.quantityis now aQuantity. CookCLI'sFreeHandItemkeeps its string quantity, so the web API's JSON is unchanged, and converts at the store boundary. The typed-item code uses the parser crate'sQuantityAPI.#,~or@. Free-hand items used to be merged into the list by re-parsing@{name}{q}as a one-line recipe. That turned#1 flourinto cookware,~rameninto a timer and@milkintomilk, so they never reached the aisle list. They now go throughIngredientList::add_shopping_itemand keep their names. This covers items typed on the web list, lines written by the apps or added from a menu's days, and the CLI's--extra.Behaviour notes
.shopping-liststores cooklang's normalised spelling (0.50%kg→0.5%kg). Removing or editing an item matches its quantity by value, so a client holding the old spelling still finds the line.--extrastill accepts one leading@, then reads the value as a one-line shopping list. Recipe-only syntax (|alias,?) is no longer read../x, text after the closing brace, and a value spanning several lines are errors.Test Plan
cargo fmt --check,cargo clippy --all-targets -- -D warningscargo test --workspace --no-fail-fast: 1969 passed. New core, server and CLI tests cover#1 flour{2},~ramenand@milk{1%l}being listed under those exact names, ticks surviving compaction, and unticking on add. They fail before the fix.cargo build --no-default-features --features server,lsp--workers=1: 16 passed, 2 skipped (both skips already in the specs)https://claude.ai/code/session_01B7jPFN3aqqHBFR4HAZyuqW