Skip to content

Document App::init() behavior with with_state constructors#212

Merged
ryanoneill merged 2 commits intomainfrom
docs/init-with-state-pattern
Mar 8, 2026
Merged

Document App::init() behavior with with_state constructors#212
ryanoneill merged 2 commits intomainfrom
docs/init-with-state-pattern

Conversation

@ryanoneill
Copy link
Owner

Summary

  • Add module-level documentation to src/app/model/mod.rs explaining the two construction patterns (standard vs external state) and when App::init() is called
  • Add a "State Initialization" section to src/app/mod.rs module docs covering the same patterns
  • Expand App::init() method docs to explain it is skipped by with_state constructors and show a stub example
  • Add explicit "not called" notes to all with_state runtime constructors in terminal.rs and runtime/mod.rs

Addresses feedback from external review (Claudio's Claude) noting that App::init() being required when using with_state is a paper cut.

Test plan

  • cargo test --doc --all-features passes (787 doc tests)
  • cargo clippy --all-features -- -D warnings clean

🤖 Generated with Claude Code

ryanoneill and others added 2 commits March 8, 2026 16:02
Clarify that App::init() is not called when using with_state
constructors (new_terminal_with_state, virtual_terminal_with_state,
etc.), and that a stub implementation is sufficient in that case.
Add module-level docs to src/app/model/mod.rs and src/app/mod.rs
explaining the two construction patterns (standard vs external state).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the `(self)` intra-doc link that pointed to a private module,
which caused `cargo doc` to fail with `-D warnings`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ryanoneill ryanoneill force-pushed the docs/init-with-state-pattern branch from 532cb69 to 8facc51 Compare March 8, 2026 23:02
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.09%. Comparing base (86fcca8) to head (8facc51).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #212   +/-   ##
=======================================
  Coverage   92.09%   92.09%           
=======================================
  Files         144      144           
  Lines       12754    12754           
=======================================
  Hits        11746    11746           
  Misses       1008     1008           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ryanoneill ryanoneill merged commit eba643d into main Mar 8, 2026
17 checks passed
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.

2 participants