Skip to content

feat: add help button opening the user guide - #27

Merged
Athemis merged 3 commits into
mainfrom
feat/help-link
Dec 10, 2025
Merged

feat: add help button opening the user guide#27
Athemis merged 3 commits into
mainfrom
feat/help-link

Conversation

@Athemis

@Athemis Athemis commented Dec 10, 2025

Copy link
Copy Markdown
Owner

Summary

  • Adds a help button for easy access to the online user guide.

Testing

  • cargo fmt
  • cargo clippy --all-targets --all-features
  • cargo test
  • cargo doc --no-deps

Platforms exercised (mark all that apply):

  • Windows
  • macOS
  • Linux

Screenshots (if UI changes)

image

Manual test steps (if UI or IO)

  • Clicked the help button, checked web browser opens and shows user guide

Docs/metadata

  • README/CONTRIBUTING updated if behavior or commands changed
  • User Guide updated (if user-facing change)

Notes for reviewers

Summary by CodeRabbit

  • New Features
    • Added a compact help button in the top bar that opens the hosted user guide in your default browser.
    • Provides feedback after attempting to open the guide, indicating success or an error if it fails.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 4fff68d and 3e36949.

📒 Files selected for processing (1)
  • src/ui/mod.rs (2 hunks)

Walkthrough

A compact help button and MVU message/command flow were added plus the open = "5" dependency, enabling the app to request the OS/browser open a help URL and report success or error back into the update loop.

Changes

Cohort / File(s) Summary
Dependency
Cargo.toml
Added dependency open = "5" under [dependencies].
MVU: messages & commands
src/mvu/mod.rs
Added Msg::OpenHelp, Msg::HelpOpened(Result<(), String>), and Command::OpenUrl { url: String }; update enqueues OpenUrl for OpenHelp and handles HelpOpened; run_command implements OpenUrl by invoking the open crate and emitting HelpOpened.
UI: help button
src/ui/mod.rs
Added private render_help_button(&mut self, ui: &mut egui::Ui) that emits Msg::OpenHelp on click; integrated the button into the top bar rendering.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant UI as UI (egui)
participant MVU as MVU update
participant Runner as Command runner
participant OS as OS/browser (open crate)
UI->>MVU: Click -> Msg::OpenHelp
MVU->>Runner: enqueue Command::OpenUrl{url}
Runner->>OS: open(url)
alt success
OS-->>Runner: Ok
Runner-->>MVU: Msg::HelpOpened(Ok)
MVU-->>UI: update state (success)
else failure
OS-->>Runner: Err
Runner-->>MVU: Msg::HelpOpened(Err)
MVU-->>UI: update state (error)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • New async command handling and result plumbing in src/mvu/mod.rs requires checking for correct dispatch and error mapping.
  • Verify render_help_button integration doesn't change layout or input focus in src/ui/mod.rs.
  • Ensure Cargo.toml dependency addition matches CI/platform targets and build features.

Poem

Engage the question-mark, set course for aid,
A tiny button charts the path that's laid.
Messages issued, commands boldly run,
The browser answers — a mission well done.
Make it so — help arrives at dawn.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the primary change: adding a help button that opens the user guide.
Description check ✅ Passed The description follows the template with all required sections completed, including summary, testing checklist, platform information, screenshots, manual testing steps, and documentation updates.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Athemis
Athemis marked this pull request as ready for review December 10, 2025 14:50

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 a cargo fmt mismatch—bring the file back to standard form

Your CI notes a Rust formatting failure around this match block. Before merging, run:

cargo fmt --all

to normalize formatting (especially around the new OpenHelp/HelpOpened arms and Command::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 clarity

The new render_help_button stays commendably side‑effect free and cleanly emits Msg::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 wiring

To keep this behavior as rigorously covered as your save and attachment flows, consider adding small tests that:

  • Assert update with Msg::OpenHelp enqueues a single Command::OpenUrl with the expected URL and sets the transient “Opening …” status.
  • Assert update with Msg::HelpOpened(Err("…".into())) sets both error and a suitable status message, and with Ok(()) clears error while updating status.

These can mirror the existing tests in this module and exercise only the update logic, without invoking open::that itself. Make it so when convenient.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9d32b8 and 5d0558c.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is 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 at src/main.rs which calls app::run() to start eframe/egui. Add SPDX headers on all source files: SPDX-License-Identifier: MIT plus one or more SPDX-FileCopyrightText lines naming actual authors.
Commands (PickFiles, HashFile, LoadThumbnail, SaveArchive) perform side-effects via run_command and emit follow-up messages back into the update loop for re-rendering.
Follow rustfmt defaults with 4-space indent and trailing commas where appropriate; run cargo fmt before committing.
Use snake_case for functions, variables, and filenames; use CamelCase for 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 marked no_run/ignore in 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.rs
  • src/ui/mod.rs
{**/*.rs,tests/**/*.rs}

📄 CodeRabbit inference engine (AGENTS.md)

Use cargo test for unit and integration coverage; colocate simple unit tests with modules and broader scenarios under tests/. Name tests after behavior (e.g., submits_trimmed_input) and keep them deterministic.

Files:

  • src/mvu/mod.rs
  • src/ui/mod.rs
{src/mvu/**/*.rs,src/ui/**/*.rs}

📄 CodeRabbit inference engine (AGENTS.md)

File dialog operations use rfd crate for cross-platform native dialogs.

Files:

  • src/mvu/mod.rs
  • src/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 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.
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.

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: open dependency aligns with the new help flow—verify platform behavior

The addition of open = "5" is a logical fit for launching the user guide from the OpenUrl command. 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‑structured

The introduction of Msg::OpenHelp/Msg::HelpOpened together with Command::OpenUrl { url } forms a clean, linear flow: the update layer merely enqueues OpenUrl and surfaces user‑friendly status messages, while run_command performs the actual open::that(url) side effect and reports back via HelpOpened. This is very much in keeping with your MVU architecture and the separation of concerns between UI, update, and IO. Do, however, verify that open::that behaves 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

@Athemis
Athemis merged commit 2f8760c into main Dec 10, 2025
10 checks passed
@Athemis
Athemis deleted the feat/help-link branch December 10, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant