@@ -190,20 +190,30 @@ pub fn run_learn(args: &[String]) -> Result<()> {
190190 candidates. len( ) . to_string( ) . yellow( ) . bold( )
191191 ) ;
192192
193+ // Header Table
194+ println ! (
195+ " {: <4} {: <10} {: <45} {: <8}" ,
196+ "#" . bright_black( ) ,
197+ "ACTION" . bright_black( ) ,
198+ "PATTERN PREVIEW" . bright_black( ) ,
199+ "COUNT" . bright_black( )
200+ ) ;
201+ println ! ( " {}" , "─" . repeat( 70 ) . bright_black( ) ) ;
202+
193203 for ( i, c) in candidates. iter ( ) . enumerate ( ) {
194- let action = format ! ( "[ {:?}] " , c. suggested_action) . to_lowercase ( ) ;
204+ let action = format ! ( "{:?}" , c. suggested_action) . to_lowercase ( ) ;
195205 let mut preview = c. trigger_prefix . clone ( ) ;
196- if preview. len ( ) > 60 {
197- preview. truncate ( 57 ) ;
206+ if preview. len ( ) > 42 {
207+ preview. truncate ( 39 ) ;
198208 preview. push_str ( "..." ) ;
199209 }
200210
201211 println ! (
202- " {:>2 }. {: <8 } {: <60} ({}x) " ,
203- i + 1 ,
212+ " {:02 }. {: <10 } {: <45} {: <8} " ,
213+ ( i + 1 ) . to_string ( ) . bright_black ( ) ,
204214 action. cyan( ) ,
205215 preview. bright_white( ) ,
206- c. count. to_string ( ) . yellow( )
216+ format! ( "{}x" , c. count) . yellow( )
207217 ) ;
208218 }
209219
@@ -220,14 +230,15 @@ pub fn run_learn(args: &[String]) -> Result<()> {
220230
221231 for ( i, rule) in correction_rules. iter ( ) . take ( 5 ) . enumerate ( ) {
222232 println ! (
223- " {:>2 }. {: <25} → {: <25} ({}x)" ,
224- i + 1 ,
233+ " {:02 }. {: <25} → {: <25} ({}x)" ,
234+ ( i + 1 ) . to_string ( ) . bright_black ( ) ,
225235 rule. wrong_pattern. red( ) ,
226236 rule. right_pattern. green( ) ,
227- rule. occurrences. to_string ( ) . yellow( )
237+ format! ( "{}x" , rule. occurrences) . yellow( )
228238 ) ;
229239 println ! (
230- " Cause: {} | Base: {}" ,
240+ " {} {} | Base: {}" ,
241+ "Cause:" . bright_black( ) ,
231242 rule. error_type. as_str( ) . bright_black( ) ,
232243 rule. base_command. bright_black( )
233244 ) ;
@@ -281,12 +292,31 @@ pub fn run_learn(args: &[String]) -> Result<()> {
281292 added,
282293 path
283294 ) ;
295+
296+ // AUTO-CLEAR QUEUE after successful apply
297+ if use_queue {
298+ let queue_path = crate :: paths:: omni_home ( ) . join ( "learn_queue.jsonl" ) ;
299+ if queue_path. exists ( ) {
300+ let _ = fs:: write ( & queue_path, "" ) ; // Truncate the file
301+ println ! (
302+ " {} Learning queue cleared. {} pending samples processed." ,
303+ "✨" . bright_white( ) ,
304+ executions. len( ) . to_string( ) . yellow( )
305+ ) ;
306+ }
307+ }
308+
284309 println ! (
285310 "{}" ,
286311 "─────────────────────────────────────────"
287312 . bright_black( )
288313 . bold( )
289314 ) ;
315+ } else {
316+ println ! (
317+ " {} No new patterns to apply (all already exist)." ,
318+ "ℹ" . blue( )
319+ ) ;
290320 }
291321 } else {
292322 println ! (
0 commit comments