Skip to content

add support for arrow key selection#37

Open
ivoninskii wants to merge 17 commits intomainfrom
ivoninskii/arrow-nav
Open

add support for arrow key selection#37
ivoninskii wants to merge 17 commits intomainfrom
ivoninskii/arrow-nav

Conversation

@ivoninskii
Copy link
Contributor

No description provided.

@ivoninskii ivoninskii marked this pull request as ready for review March 15, 2026 22:19
@SokolovYaroslav SokolovYaroslav requested a review from Copilot March 16, 2026 09:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an interactive prompting layer to the Databao CLI (intended to enable arrow-key selection in TTYs via questionary) and updates CLI messaging to consistently refer to “Context Engine”.

Changes:

  • Add questionary dependency and introduce new CLI prompt helpers (ask_select/ask_confirm/ask_text) with label support.
  • Update datasource add flow and tests to use the new prompting mechanism.
  • Refresh various user-facing strings (Context Engine terminology, app/ask/status messaging).

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
pyproject.toml Adds questionary runtime dependency.
uv.lock Lockfile update to include questionary (and related lock churn).
src/databao_cli/utils.py New prompt abstraction layer (TTY uses questionary, non-TTY uses click).
src/databao_cli/labels.py Adds label mappings for nicer interactive choice titles.
src/databao_cli/__main__.py Registers labels and swaps click.confirm usage to the new helper.
src/databao_cli/commands/datasource/add_datasource_config.py Moves prompts to the new helpers (select/confirm/text).
tests/test_add_datasource.py Attempts to adapt tests for new selection behavior.
src/databao_cli/mcp/tools/databao_ask/agent_factory.py Messaging updates (“Context Engine”, punctuation tweaks).
src/databao_cli/commands/status.py Messaging updates in status output.
src/databao_cli/commands/ask.py Messaging updates for interactive help/unknown command text.
src/databao_cli/commands/app.py Messaging updates for app startup/shutdown/errors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +19 to +20
def ask_select(message: str, choices: list[str], default: str = None) -> str:
"""Select from a list. Interactive in TTY, plain text otherwise."""
def ask_text(message: str, default: str = None) -> str:
"""Text input. Interactive in TTY, plain click.prompt otherwise."""
if is_interactive():
return questionary.text(message, default=default or "").ask()
Comment on lines +31 to +37
click.echo(f"{message}")
for i, choice in enumerate(choices, 1):
click.echo(f" {i}. {choice}")
value = click.prompt(
"Enter a number of value",
default=default or choices[0],
)
Comment on lines +51 to 55
config_type = ask_select(
"What type of datasource do you want to add?",
type=click.Choice(all_datasource_types),
default=all_datasource_types[0] if len(all_datasource_types) == 1 else None,
choices=all_datasource_types,
default=all_datasource_types[0] if len(all_datasource_types) == 0 else None,
)
Comment on lines +39 to +42
prompt = Mock()
prompt.ask.return_value = "parquet"
monkeypatch.setattr(add_datasource_config.questionary, "select", Mock(return_value=prompt))

prompt.ask.return_value = "parquet"
monkeypatch.setattr(add_datasource_config.questionary, "select", Mock(return_value=prompt))

inputs = [
Comment on lines +4 to +7

_labels: dict[str, str] = {}

def register_labels(labels: dict) -> None:
RuslanGolov and others added 11 commits March 16, 2026 11:03
(cherry picked from commit d65b198)
* Edit UI texts

* lint: ignore ambiguous unicode character warnings (RUF001) in Ruff configuration

---------

Co-authored-by: ruslan.golov <ruslan.golov@jetbrains.com>
(cherry picked from commit 23191a0)
Copy link
Collaborator

@RuslanGolov RuslanGolov left a comment

Choose a reason for hiding this comment

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

This improvement affects the core user experience. I fixed the inspections and some bugs, but I still see them. (For example, you can't cancel entering the datasource name) I can fix this, but perhaps it's better to delegate this task to the development team. Therefore, it needs to be more carefully developed and tested. E2E tests also need to be updated.

@RuslanGolov
Copy link
Collaborator

I fixed most of the bugs and inspections. I'm willing to look at the e2e tests if the Dev team is ready for these changes.

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.

4 participants