Skip to content

Extract prompt UI and tests into separate modules (vertical-slice refactor)#15

Merged
enijburg merged 2 commits into
mainfrom
codex/apply-vertical-slice-architecture
May 15, 2026
Merged

Extract prompt UI and tests into separate modules (vertical-slice refactor)#15
enijburg merged 2 commits into
mainfrom
codex/apply-vertical-slice-architecture

Conversation

@enijburg
Copy link
Copy Markdown
Owner

@enijburg enijburg commented May 15, 2026

Motivation

  • src/main.rs had grown too large and mixed runtime UI prompts and test code with core viewer logic, reducing maintainability.
  • Introduce clearer vertical slices so interactive prompt behavior and tests live in their own modules and the core runtime file is smaller and easier to navigate.

Description

  • Extracted prompt_goto_line and prompt_find from src/main.rs into src/ui/prompt.rs and made them pub(crate) so the main runtime can call them via use ui::prompt::{prompt_find, prompt_goto_line}.
  • Added a UI module boundary by creating src/ui/mod.rs and wired main.rs to import the prompt functions from the new UI slice (mod ui;).
  • Moved the inline test module out of src/main.rs into src/tests.rs and replaced the in-file test block with mod tests; to separate verification code from runtime code.
  • Kept existing runtime logic intact; only prompt logic and test placement/visibility were changed to reduce main.rs size.

Testing

  • Ran formatter with cargo fmt, which completed successfully.

Codex Task

@enijburg enijburg merged commit 52b3aa9 into main May 15, 2026
2 checks passed
@enijburg enijburg deleted the codex/apply-vertical-slice-architecture branch May 15, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant