Skip to content
This repository was archived by the owner on Apr 29, 2026. It is now read-only.

⏺ All 70 tests pass. Now all commands are added to history:#340

Merged
navicore merged 1 commit intomainfrom
cmd-host
Jan 29, 2026
Merged

⏺ All 70 tests pass. Now all commands are added to history:#340
navicore merged 1 commit intomainfrom
cmd-host

Conversation

@navicore
Copy link
Copy Markdown
Owner

  • :clear, :pop, :stack, :show - added
  • :ir, :ir stack, :ir ast, :ir llvm - added
  • :edit/:e, :help/:h - added (preserves alias used)
  • :include - added (full command with module name)
  • :quit/:q - not added (exits immediately)

You can now navigate through commands and Seq code together with k.

  - :clear, :pop, :stack, :show - added
  - :ir, :ir stack, :ir ast, :ir llvm - added
  - :edit/:e, :help/:h - added (preserves alias used)
  - :include <module> - added (full command with module name)
  - :quit/:q - not added (exits immediately)

  You can now navigate through commands and Seq code together with k.
@claude
Copy link
Copy Markdown

claude Bot commented Jan 29, 2026

Pull Request Review: Command History Enhancement

Summary

This PR enhances the REPL by adding most commands to the history, allowing users to navigate through both commands and Seq code together using the k key in vi mode. The implementation is well-structured and maintains consistency with existing patterns.

Strengths

Code Quality

  • Consistent pattern: All command history additions follow the same pattern
  • Clean separation of concerns: The new show_stack_in_ir_pane() method properly separates informational display from history-tracked operations
  • Preserves command aliases: For :edit/:e and :help/:h, the actual command used is preserved in history
  • Good documentation: Updated comments clearly explain the distinction between history-tracked operations and informational displays

Architecture

  • Refactored compile_and_show_stack(): Changed from using a label to using the actual command string, making the history more accurate
  • Dual display approach: The :pop command shows results in the IR pane without cluttering history, while :stack adds to history with output

Observations & Suggestions

1. Inconsistency in :pop vs :stack behavior

The PR shows different approaches:

  • :pop calls show_stack_in_ir_pane() (displays in IR pane, no output in history)
  • :stack calls compile_and_show_stack() (adds to history with output)

Question: Is this intentional? The current design seems reasonable, but consider documenting this distinction.

2. Error handling in show_stack_in_ir_pane()

The new method silently ignores all errors (lines 1111-1118). Consider whether users should be notified when stack display fails, perhaps by showing an error message in the IR pane.

3. Code duplication

The methods compile_and_show_stack() and show_stack_in_ir_pane() share approximately 80% of their code. Consider extracting the common logic to reduce maintenance burden.

4. Command string preservation

For commands with arguments like :include module, the full command string is preserved (line 1035). This is excellent - users can recall :include mymodule in history.

Testing Considerations

The PR states All 70 tests pass. Consider adding tests for:

  1. History navigation: Verify commands are added in the correct order
  2. Command recall: Test that recalling :pop or :clear from history works correctly
  3. Edge cases: Empty module names, toggling :ir multiple times
  4. Alias preservation: Verify that :e is stored as :e not :edit

Security & Performance

  • No security concerns: Commands are trusted input from the user
  • Performance: The added add_entry() calls are O(1) operations with minimal overhead
  • Memory: History is bounded, so no memory leak concerns

Overall Assessment

This is a solid PR that improves user experience meaningfully. The code quality is good, the design decisions are thoughtful, and the implementation follows existing patterns. Main suggestions: reduce code duplication, improve error feedback, and add targeted tests.

Recommendation: Approve with minor suggestions for future improvements.

@navicore navicore merged commit d33d7fb into main Jan 29, 2026
2 checks passed
@navicore navicore deleted the cmd-host branch January 29, 2026 15:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant