Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

AI DJ prompt: the caret stays at the end of the text when moving the cursor back to edit

Chiusa
#945 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #946 di @JosephAnderson234 — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
cli, frontend

Direzione di ricerca

Read src/tui/ui/ai_dj.rs and src/tui/handlers/ai_dj.rs, then build with cargo run --features ai-dj and reproduce by moving the cursor left in the prompt. The issue reports an open linked pull request, so the work may already be underway. Done means the caret is drawn at the cursor position while editing.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
What happened

In the AI DJ screen, the caret (▏) in the "Ask the DJ" prompt is always painted at the end of the text, even when the cursor is somewhere else. If I type a message, press Left a few times to fix an earlier word, and then type or Backspace, the edit goes to the right place, but the caret stays at the end. You can't see where the next character will go.

I first noticed it with Claude (through the claude CLI) as the DJ backend, but the prompt is the same for every backend, so it should happen with all of them.

Expected: the caret sits at the cursor position, between the characters being edited.

Cause

The key handler (src/tui/handlers/ai_dj.rs) keeps input_idx and input_cursor correct for Left/Right, Home/End, Backspace and Delete. draw_prompt in src/tui/ui/ai_dj.rs only uses the cursor to work out the horizontal scroll, then pushes the caret span after the whole visible text:

let mut spans = vec![Span::styled(visible, ...)];
if focused {
  spans.push(Span::styled("▏", ...));
}
Steps to reproduce
  1. Build with the AI DJ (cargo run --features ai-dj) and open the AI DJ screen
  2. Type mellow
  3. Press Left twice
  4. See the caret still after mellow instead of between mell and ow; typing x gives mellxow, with the caret still at the end
Frontend

Terminal app

Source

Not about a source

spotatui version

0.47.0 (reproduced on main at ae9524b)

OS

Windows 11

How you installed spotatui

Built from source

Lingua principale
Rust
Stelle
1.4k
Fork
238
Merge medio
11h 26m
PR unite (30g)
195

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LargeModGames/spotatui

Tutte le issue di LargeModGames/spotatui

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.