Skip to content

[codex] Add onboarding journal setup and initial index default#46

Merged
cleak merged 1 commit into
masterfrom
codex/onboarding-index-journal-setup
May 6, 2026
Merged

[codex] Add onboarding journal setup and initial index default#46
cleak merged 1 commit into
masterfrom
codex/onboarding-index-journal-setup

Conversation

@cleak
Copy link
Copy Markdown
Owner

@cleak cleak commented May 4, 2026

Summary

This updates Tempyr onboarding so the interactive flow makes both setup concerns explicit:

  • default the interactive init wizard to run the initial structural index rebuild after setup
  • add a dedicated journal setup page with toggles for journal auto-publish, journal ref fetch configuration, and local journal layout bootstrap
  • route the selected journal setup choices through tempyr init instead of silently applying the old implicit behavior
  • add focused tests for the new wizard defaults, journal toggles, index rebuild side effect, and journal layout bootstrap

Why

Users could complete onboarding without getting an initial index, and journal setup was inferred from repo visibility without an explicit onboarding prompt. The wizard now shows those choices directly, while non-interactive init stays conservative about potentially expensive index work.

Validation

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test -p tempyr-cli
  • cargo test
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Added a dedicated journal setup step to onboarding with interactive toggles for enabling the journal, fetch refspec, and layout bootstrap.
    • Project init now applies journal setup choices and may bootstrap journal layout during init.
  • Bug Fixes

    • Journal-related defaults now derive from repository context and are consistently applied in non-interactive flows.
  • Tests

    • Added coverage for initial index rebuild and journal bootstrap/idempotency during init.
  • Documentation

    • Updated test docs/comments describing journal lifecycle and bootstrap behavior.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 94edcd71-1542-49b6-9e69-e2c809ddf16f

📥 Commits

Reviewing files that changed from the base of the PR and between d6e0d6d and 801a8eb.

📒 Files selected for processing (3)
  • crates/tempyr-cli/src/commands/init.rs
  • crates/tempyr-cli/src/commands/onboarding.rs
  • crates/tempyr-cli/tests/integration.rs

📝 Walkthrough

Walkthrough

Init now computes journal setup defaults from repository context and passes them into onboarding and non-interactive flows. Journal configuration is applied during project initialization via a new apply_journal_init path; onboarding gains a dedicated JournalSetup page and selections are persisted into initialization logic and tests.

Changes

Journal Setup in Init & Onboarding

Layer / File(s) Summary
Data Shape
crates/tempyr-cli/src/commands/onboarding.rs
Adds JournalSetupDefaults (enable_journal, configure_journal_fetch_refspec, bootstrap_journal_layout) and extends OnboardingSelections with the same three booleans.
Default Computation
crates/tempyr-cli/src/commands/init.rs
Adds journal_setup_defaults(root: &Path) and is_inside_git_repo(root: &Path) to derive journal defaults from git presence/visibility.
Wizard Init & Routing
crates/tempyr-cli/src/commands/onboarding.rs
run(...) now accepts journal_defaults; WizardState gains journal_index; pages always include Page::JournalSetup; new_with_journal_defaults initializes selections from defaults.
Interaction Handling
crates/tempyr-cli/src/commands/onboarding.rs
Adds handle_journal_setup, toggle_journal_option, and journal option enums to navigate and toggle the three journal choices.
Rendering
crates/tempyr-cli/src/commands/onboarding.rs
Adds render_journal_setup, updates header/footer text and welcome list, and shows journal details in the Review page.
Init Integration
crates/tempyr-cli/src/commands/init.rs
run() computes journal_defaults and threads into onboarding or noninteractive_defaults; initialize_project() calls new apply_journal_init() before writing config.
Journal Apply / Outcome
crates/tempyr-cli/src/commands/init.rs
Replaces decide_journal_init with apply_journal_init returning JournalInitOutcome { summary_lines }; journal_config_summary now formats [journal] enabled = ... from explicit selection and git context.
Tests & Coverage
crates/tempyr-cli/src/commands/init.rs, crates/tempyr-cli/src/commands/onboarding.rs, crates/tempyr-cli/tests/integration.rs
Adds tests for initial index rebuild and journal bootstrap during init; updates onboarding tests for new page ordering and per-option toggles; minor integration test doc and assertion tweaks.

Sequence Diagram

sequenceDiagram
    participant User
    participant Init as init::run()
    participant GitDetect as journal_setup_defaults()
    participant Onboarding as onboarding::run()
    participant Wizard as WizardState
    participant Apply as apply_journal_init()

    User->>Init: Start `tempyr init`
    Init->>GitDetect: Compute JournalSetupDefaults from repo/git visibility
    GitDetect-->>Init: Return defaults
    Init->>Onboarding: Launch wizard (interactive) or noninteractive with defaults
    Onboarding->>Wizard: Initialize pages including JournalSetup with defaults
    User->>Onboarding: Interact (toggle journal options)
    Wizard-->>Onboarding: Return OnboardingSelections
    Onboarding-->>Init: Complete with selections
    Init->>Apply: apply_journal_init(root, selections)
    Apply-->>Init: Return summary lines (refspec/config/bootstrap attempts)
    Init-->>User: Write config + output summary
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

A rabbit hops through repo light and dim,
Defaults from Git whisper, "enable the brim."
Toggles clicked, the journal wakes and hums,
Bootstrap, fetch, and index—ready as drums. 🐇📚✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.83% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main changes: adding a dedicated journal setup page to the onboarding wizard and making the initial index rebuild (via defaults) explicit in the init command.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/onboarding-index-journal-setup

Review rate limit: 3/5 reviews remaining, refill in 13 minutes and 21 seconds.

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/tempyr-cli/src/commands/init.rs`:
- Around line 72-85: The noninteractive_defaults function is hard-coding
bootstrap_journal_layout to false which ignores the computed setting in
JournalSetupDefaults; change the OnboardingSelections construction in
noninteractive_defaults to set bootstrap_journal_layout:
journal_defaults.bootstrap_journal_layout (i.e., propagate the
JournalSetupDefaults.bootstrap_journal_layout value into OnboardingSelections)
so the --no-wizard path respects the previously computed default.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 019f6bea-8c17-49a2-bd2b-b224e54a5f0d

📥 Commits

Reviewing files that changed from the base of the PR and between ef0d861 and d6e0d6d.

📒 Files selected for processing (2)
  • crates/tempyr-cli/src/commands/init.rs
  • crates/tempyr-cli/src/commands/onboarding.rs

Comment thread crates/tempyr-cli/src/commands/init.rs Outdated
@cleak cleak force-pushed the codex/onboarding-index-journal-setup branch from d6e0d6d to 801a8eb Compare May 4, 2026 05:53
@cleak cleak merged commit e8c4d14 into master May 6, 2026
5 checks passed
@cleak cleak deleted the codex/onboarding-index-journal-setup branch May 6, 2026 02:52
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