PR Reviewer Guide 🔍Here are some key observations to aid the review process: | ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪ | | 🧪 No relevant tests | | 🔒 No security concerns identified | ⚡ Recommended focus areas for review
Undefined Variableconfig_file_path is not defined inshould_modify_pyproject_toml, causing a NameError whendisplay_current_config is called.
display_current_config(config,config_file_path)returnshould_reconfigure Incompatible Type AnnotationThe signaturePath | None requires Python 3.10+. If older versions are supported, useOptional[Path] fromtyping. defbrowse_and_select_directory(start_dir:Path,message:str,title:str)->Path|None: Unbounded Loopbrowse_and_select_directory uses an unboundedwhile True. Invalid inputs (e.g., bad custom paths) could trap the user in the loop; consider retry limits or a clear exit option.
defbrowse_and_select_directory(start_dir:Path,message:str,title:str)->Path|None:"""Interactive directory browser with tab-completion-like functionality."""current_dir=start_dirwhileTrue:# Get all subdirectories in current directorytry:subdirs= []foritemincurrent_dir.iterdir():ifitem.is_dir()andnotitem.name.startswith('.'):subdirs.append(item.name)subdirs.sort()exceptPermissionError:console.print(f"❌ Permission denied accessing{current_dir}")returnNone# Build choices listchoices= []# Add parent directory option if not at start_dirifcurrent_dir!=start_dirandcurrent_dir.parent!=current_dir:choices.append(("📁 .. (parent directory)",".."))# Add current directory selection optionchoices.append(("✅ Select this directory","SELECT"))# Add subdirectoriesforsubdirinsubdirs:choices.append((f"📂{subdir}/",subdir))# Add option to type custom pathchoices.append(("⌨️ Type custom path","CUSTOM"))choices.append(("❌ Cancel","CANCEL"))# Show current directory in panelbrowse_panel=Panel(Text(f"📍 Current directory:{current_dir}\n\n{message}",style="cyan"),title=title,border_style="bright_blue", )console.print(browse_panel)console.print()# Prompt for selectionquestions= [inquirer.List("selection",message="Navigate or select directory:",choices=choices,carousel=True, ) ]answers=inquirer.prompt(questions,theme=CodeflashTheme())ifnotanswers:returnNoneselection=answers["selection"]ifselection=="SELECT":returncurrent_direlifselection=="CANCEL":returnNoneelifselection=="..":current_dir=current_dir.parentelifselection=="CUSTOM":# Allow custom path inputcustom_panel=Panel(Text("Enter a directory path (relative to current directory or absolute):",style="yellow"),title="🔧 Custom Path",border_style="bright_yellow", )console.print(custom_panel)console.print()custom_path=click.prompt("Directory path",type=str).strip()ifcustom_path:try:ifPath(custom_path).is_absolute():new_dir=Path(custom_path)else:new_dir=current_dir/custom_pathnew_dir=new_dir.resolve()ifnew_dir.exists()andnew_dir.is_dir():current_dir=new_direlse:console.print(f"❌ Directory does not exist:{new_dir}")click.pause()exceptExceptionase:console.print(f"❌ Invalid path:{e}")click.pause()else:# Navigate to subdirectorytry:new_dir=current_dir/selectionifnew_dir.exists()andnew_dir.is_dir():current_dir=new_direlse:console.print(f"❌ Directory not accessible:{new_dir}")click.pause()exceptExceptionase:console.print(f"❌ Error accessing directory:{e}")click.pause() |
|
Uh oh!
There was an error while loading.Please reload this page.
When user already have a CF configuration:

Giving option to select nested directory on test file:

PR Type
Enhancement
Description
Add interactive directory browser functionality
Implement display_current_config for existing settings
Update reconfiguration prompt UX in init flow
Use browser for tests directory selection
Changes diagram
Changes walkthrough 📝
cmd_init.py
Add directory browser and config displaycodeflash/cli_cmds/cmd_init.py