Skip to content

fix(flags): add a new experimental-features flag to gate new features starting with the existing "tui" flag#385

Merged
9999years merged 4 commits intomainfrom
kallev/experimental-features
Mar 10, 2026
Merged

fix(flags): add a new experimental-features flag to gate new features starting with the existing "tui" flag#385
9999years merged 4 commits intomainfrom
kallev/experimental-features

Conversation

@kallevmercury
Copy link
Copy Markdown
Contributor

@kallevmercury kallevmercury commented Mar 10, 2026

Add a new experimental-features flag:

cargo run -- --experimental-features tui --command 'ghci'
Screenshot 2026-03-10 at 5 49 39 PM

It's hidden from the help text as well but will report if the flags don't match:

cargo run -- --experimental-features bogus
Screenshot 2026-03-10 at 3 48 51 PM

Based on:
#380 (review)

  • Labeled the PR with patch, minor, or major to request a version bump when it's merged.
  • Updated the user manual in docs/.
  • Added integration / regression tests in tests/.

@kallevmercury kallevmercury added the patch Bug fixes or non-functional changes label Mar 10, 2026
@kallevmercury kallevmercury requested a review from 9999years March 10, 2026 20:31
@kallevmercury kallevmercury changed the title fix(flags): add a new experimental-features flag to gate new features fix(flags): add a new experimental-features flag to gate new features starting with the existing "tui" flag Mar 10, 2026
Copy link
Copy Markdown
Member

@9999years 9999years left a comment

Choose a reason for hiding this comment

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

Looks pretty good! I'd like a couple small changes, and I think we should add two tests:

  1. If we start ghciwatch with ghciwatch --experimental-features asdlfkjaslkdgjs then it errors immediately instead of starting.

    Something like assert!(GhciWatchBuilder::new("tests/data/simple").with_args(["--experimental-features", "asdflkj"]).start().await.is_err());, but you can look at the other tests for examples.

  2. If we start ghciwatch with ghciwatch --experimental-features tui we get a warning that it's experimental.

    Similar, with something like session.wait_for_log("literal text of the log message here").await.unwrap(). There's a fancier log matching DSL available as well; I don't think you'll need it, but you can do something like "literal log message".into_matcher().but_not(BaseMatcher::ghci_started()).

I think that'll be pretty easy, but let me know if you have trouble.

Comment thread src/tui/mod.rs Outdated
Comment thread tests/clap_markdown.rs
Comment thread src/cli.rs
@kallevmercury kallevmercury requested a review from a team as a code owner March 10, 2026 21:50
Comment on lines +20 to +21
/// Runs ghciwatch directly (not via `GhciWatchBuilder`) because TUI mode
/// crashes without a terminal, exiting before the test harness can connect.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh man, that's frustrating!! Maybe we can replace this with a test for your feature when we get that merged lol

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Lol yes! That was the main issue I ran into trying to get the tests running.

Copy link
Copy Markdown
Member

@9999years 9999years left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this!!

@9999years 9999years merged commit 4c12cb4 into main Mar 10, 2026
39 checks passed
@9999years 9999years deleted the kallev/experimental-features branch March 10, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bug fixes or non-functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants