feat: add help button opening the user guide - #27
Conversation
|
Warning Rate limit exceeded@Athemis has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 14 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughA compact help button and MVU message/command flow were added plus the Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/mvu/mod.rs (1)
255-329: CI reports acargo fmtmismatch—bring the file back to standard formYour CI notes a Rust formatting failure around this match block. Before merging, run:
cargo fmt --allto normalize formatting (especially around the new
OpenHelp/HelpOpenedarms andCommand::OpenUrl) and satisfy the formatter gate. A minor housekeeping step, but necessary to clear the build.
🧹 Nitpick comments (2)
src/ui/mod.rs (1)
107-113: Help button wiring is sound; consider a short label for clarityThe new
render_help_buttonstays commendably side‑effect free and cleanly emitsMsg::OpenHelp, integrating neatly into the top bar. For users who may not immediately infer a lone question‑mark icon, you might consider a compact icon+text label such as:let button = egui::Button::new(format!("{} Help", egui_phosphor::regular::QUESTION));to match other top‑bar controls and improve discoverability. Make it so only if you judge the extra text worth the space. As per coding guidelines and retrieved learnings, this still keeps UI strings short and MVU responsibilities well separated.
Also applies to: 170-181
src/mvu/mod.rs (1)
215-233: Add focused tests for the new help status and command wiringTo keep this behavior as rigorously covered as your save and attachment flows, consider adding small tests that:
- Assert
updatewithMsg::OpenHelpenqueues a singleCommand::OpenUrlwith the expected URL and sets the transient “Opening …” status.- Assert
updatewithMsg::HelpOpened(Err("…".into()))sets botherrorand a suitable status message, and withOk(())clearserrorwhile updatingstatus.These can mirror the existing tests in this module and exercise only the update logic, without invoking
open::thatitself. Make it so when convenient.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
Cargo.toml(1 hunks)src/mvu/mod.rs(4 hunks)src/ui/mod.rs(2 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Entry point atsrc/main.rswhich callsapp::run()to start eframe/egui. Add SPDX headers on all source files:SPDX-License-Identifier: MITplus one or moreSPDX-FileCopyrightTextlines naming actual authors.
Commands (PickFiles,HashFile,LoadThumbnail,SaveArchive) perform side-effects viarun_commandand emit follow-up messages back into the update loop for re-rendering.
Follow rustfmt defaults with 4-space indent and trailing commas where appropriate; runcargo fmtbefore committing.
Usesnake_casefor functions, variables, and filenames; useCamelCasefor types; keep module files small and focused.
Use English language within the codebase.
Use code comments sparingly to explain intent, invariants, or non-obvious control flow; avoid restating what the code already makes clear.
Use rustdoc with///for public items and//!for module-level docs; start with one-line summary ending with period; structure details with#headings (e.g.,# Examples,# Errors,# Panics,# Safety,# Performance).
Include small, runnable examples markedno_run/ignorein rustdoc when side effects exist; keep examples minimal and dependency-free.
In rustdoc, explain invariants, panics, and error cases explicitly; prefer present tense and describe behavior, not intent.
Use intra-doc links in rustdoc like[`TypeName`]or[`module::function`]; disambiguate with full paths when needed.
Document private helpers in rustdoc when it aids maintainers; keep explanations concise.
Files:
src/mvu/mod.rssrc/ui/mod.rs
{**/*.rs,tests/**/*.rs}
📄 CodeRabbit inference engine (AGENTS.md)
Use
cargo testfor unit and integration coverage; colocate simple unit tests with modules and broader scenarios undertests/. Name tests after behavior (e.g.,submits_trimmed_input) and keep them deterministic.
Files:
src/mvu/mod.rssrc/ui/mod.rs
{src/mvu/**/*.rs,src/ui/**/*.rs}
📄 CodeRabbit inference engine (AGENTS.md)
File dialog operations use
rfdcrate for cross-platform native dialogs.
Files:
src/mvu/mod.rssrc/ui/mod.rs
Cargo.toml
📄 CodeRabbit inference engine (AGENTS.md)
Maintain Rust 2024 crate with no build script needed; egui compiles directly with the Rust code.
Files:
Cargo.toml
{src/ui/**/*.rs,src/ui/components/**/*.rs}
📄 CodeRabbit inference engine (AGENTS.md)
{src/ui/**/*.rs,src/ui/components/**/*.rs}: UI components insrc/ui/andsrc/ui/components/*must remain side-effect free and emit messages only; all validation and state transitions belong insrc/mvu/or model/logic modules; IO happens only in commands executed byrun_command.
Use Phosphor icons viaegui_phosphor::regular::NAME(withRichTextor button labels) instead of embedding SVGs. The font is registered insrc/main.rs. Keep icon+text buttons short usingformat!("{} Label", icon)and reuse existing helpers insrc/ui.rs.
Files:
src/ui/mod.rs
{src/ui/**/*.rs,src/app/**/*.rs}
📄 CodeRabbit inference engine (AGENTS.md)
No external assets are fetched at runtime; all UI is generated by egui at runtime.
Files:
src/ui/mod.rs
🧠 Learnings (6)
📚 Learning: 2025-12-03T16:16:45.376Z
Learnt from: CR
Repo: Athemis/ELNPack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T16:16:45.376Z
Learning: MVU architecture: Model layer in `mvu::AppModel` and per-component models (`MarkdownModel`, `DateTimeModel`, `KeywordsModel`, `AttachmentsModel`); View layer with component `view(...) -> Vec<Msg>` in `ui/components/*`; Update layer in `mvu::update` routing messages to reducers and enqueuing Commands.
Applied to files:
src/mvu/mod.rs
📚 Learning: 2025-12-03T16:16:45.376Z
Learnt from: CR
Repo: Athemis/ELNPack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T16:16:45.376Z
Learning: Applies to {src/ui/**/*.rs,src/ui/components/**/*.rs} : UI components in `src/ui/` and `src/ui/components/*` must remain side-effect free and emit messages only; all validation and state transitions belong in `src/mvu/` or model/logic modules; IO happens only in commands executed by `run_command`.
Applied to files:
src/mvu/mod.rs
📚 Learning: 2025-12-03T16:16:45.376Z
Learnt from: CR
Repo: Athemis/ELNPack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T16:16:45.376Z
Learning: Applies to Cargo.toml : Maintain Rust 2024 crate with no build script needed; egui compiles directly with the Rust code.
Applied to files:
Cargo.toml
📚 Learning: 2025-12-03T16:16:45.376Z
Learnt from: CR
Repo: Athemis/ELNPack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T16:16:45.376Z
Learning: Applies to src/ui.rs : UI strings live directly in `src/ui.rs` within the egui code; prefer short, actionable labels.
Applied to files:
src/ui/mod.rs
📚 Learning: 2025-12-03T16:16:45.376Z
Learnt from: CR
Repo: Athemis/ELNPack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T16:16:45.376Z
Learning: Applies to {src/ui/**/*.rs,src/ui/components/**/*.rs} : Use Phosphor icons via `egui_phosphor::regular::NAME` (with `RichText` or button labels) instead of embedding SVGs. The font is registered in `src/main.rs`. Keep icon+text buttons short using `format!("{} Label", icon)` and reuse existing helpers in `src/ui.rs`.
Applied to files:
src/ui/mod.rs
📚 Learning: 2025-12-03T16:16:45.376Z
Learnt from: CR
Repo: Athemis/ELNPack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T16:16:45.376Z
Learning: Applies to {src/ui.rs,src/logic/eln.rs} : Separate UI concerns in `src/ui.rs` from business logic in `src/logic/eln.rs` for maintainability and testability.
Applied to files:
src/ui/mod.rs
🪛 GitHub Actions: CI
src/mvu/mod.rs
[error] 224-230: Rust formatting check failed. The cargo fmt check detected formatting changes needed. Run 'cargo fmt --all' to fix formatting.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (rust)
🔇 Additional comments (2)
Cargo.toml (1)
14-37:opendependency aligns with the new help flow—verify platform behaviorThe addition of
open = "5"is a logical fit for launching the user guide from theOpenUrlcommand. Please confirm this version behaves as expected on all target platforms (in particular minimal/headless Linux environments) and that its default features are acceptable for your distribution story. Engage your CI or manual checks to validate before shipping.src/mvu/mod.rs (1)
49-59: Help‑opening MVU flow is cohesive and well‑structuredThe introduction of
Msg::OpenHelp/Msg::HelpOpenedtogether withCommand::OpenUrl { url }forms a clean, linear flow: the update layer merely enqueuesOpenUrland surfaces user‑friendly status messages, whilerun_commandperforms the actualopen::that(url)side effect and reports back viaHelpOpened. This is very much in keeping with your MVU architecture and the separation of concerns between UI, update, and IO. Do, however, verify thatopen::thatbehaves reliably on all supported platforms and environments (e.g., default browser resolution and error semantics), then proceed. As per coding guidelines and retrieved learnings, side effects are rightly confined to commands.Also applies to: 75-83, 215-233, 324-327
Summary
Testing
cargo fmtcargo clippy --all-targets --all-featurescargo testcargo doc --no-depsPlatforms exercised (mark all that apply):
Screenshots (if UI changes)
Manual test steps (if UI or IO)
Docs/metadata
Notes for reviewers
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.