diff --git a/README.md b/README.md index dae6dee..daec08e 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ INSTA_UPDATE=no PROPTEST_CASES=256 cargo test --workspace --all-targets --locked - На узком терминале в dual отображается активная панель с индикатором `PANE 1/2` или `PANE 2/2`; состояние скрытой панели сохраняется. - `F3` открывает временный preview поверх любой раскладки. - Постоянной нижней строки hints нет: её место занимает содержимое, а `? Help` остаётся в header на каждом поддерживаемом размере. -- Видимые каталоги перечитываются с bounded интервалом 1 секунда: внешние create/rename/delete появляются без ручного refresh; loading не создаёт очередь запросов. Фоновый poll не показывает `LOADING` и не меняет текущий кадр, строку entries или пустое состояние до получения ответа. Preview того же выбранного элемента также остаётся видимым без `LOADING PREVIEW` и обновляется атомарно; при смене выбора старое содержимое очищается, а быстрые selection changes коалесцируются за 40 ms без промежуточных reads и loading-flash. Polling приостанавливается во время planning/confirmation и внешнего редактора, чтобы фоновый listing не инвалидировал ожидающий snapshot. +- Видимые каталоги перечитываются с bounded интервалом 1 секунда: внешние create/rename/delete появляются без ручного refresh; loading не создаёт очередь запросов. Фоновый poll не показывает `LOADING` и не меняет текущий кадр, строку entries или пустое состояние до получения ответа. Preview того же выбранного элемента также остаётся видимым без `LOADING PREVIEW` и обновляется атомарно; при смене выбора старое содержимое очищается, а быстрые selection changes коалесцируются за 40 ms без промежуточных reads и loading-flash, включая уже запущенный selection read. Polling приостанавливается во время planning/confirmation и внешнего редактора, чтобы фоновый listing не инвалидировал ожидающий snapshot. - Встроены 20 offline-тем (11 dark / 9 light), по умолчанию — Night Ops с прежними базовыми accents и зафиксированной accessibility-коррекцией selection; `NO_COLOR` и ASCII fallback сохраняют маркеры и структуру. - File icons различают каталоги, точные проектные имена, расширения, links и executables; цвет иконки и semantic цвет имени независимы. Rust имеет отдельный glyph; при включённых иконках избыточный `TYPE` не выводится, а в `none` сохраняются текстовые `DIR`/`FILE`/`LINK`/`OTH`. @@ -119,7 +119,7 @@ Copy/move сначала выполняют read-only preflight и показы - Текстовый preview читает не более **64 KiB** и показывает маркер усечения. - PNG/JPEG/GIF/BMP/WebP определяются по content magic и показываются реальными pixels в persistent/F3. Encoded input ограничен **16 MiB**, 8192 на ось, 32M pixels и 256 MiB decoder allocation; animated input становится static. Один serialized worker не пишет terminal, prepared images инвалидируются по selection/generation/endpoint/geometry/terminal epoch. Kitty/iTerm2/Sixel — best-effort через `ratatui-image`; halfblocks — universal fallback, tmux не изменяет `allow-passthrough`. `NO_COLOR`, ASCII/dumb, non-TTY, `images=false` и `--no-images` используют metadata fallback без probe. -- Preview каталога нерекурсивный и содержит не более **100 имён**. +- Preview каталога нерекурсивный и содержит не более **100 имён**; вложенные каталоги/файлы получают те же semantic icons, что и основной список. - Binary/unsupported content заменяется placeholder с метаданными. - UTF-8 ошибки заменяются символом `�`; управляющие и опасные bidi-символы экранируются. - Содержимое файлов никогда не исполняется. diff --git a/docs/acceptance.md b/docs/acceptance.md index 6033cf8..7944a96 100644 --- a/docs/acceptance.md +++ b/docs/acceptance.md @@ -284,3 +284,9 @@ cargo test --test ssh_hermesvm -- --ignored --nocapture - Fixed Kitty/iTerm2/Sixel/halfblock protocols создаются вне Frame. Один global semaphore сериализует blocking work, cancellation checkpoints отбрасывают stale results, cache содержит не более одного prepared protocol на панель и проверяет полную identity. Persistent/F3, resize, terminal epoch и cleanup покрыты runtime tests. - Под tmux используется прямой Halfblocks constructor без любого `Picker`; disabled/NO_COLOR/ASCII/dumb/non-TTY не испускают probe. Production PTY с реальными pixels и substitute-tmux marker — PASS. - `tests/image_preview.rs`: **11 passed**; `tests/image_runtime.rs`: **11 passed**, включая max-active=1 и отмену до blocking start; общий suite: **651 passed, 0 failed, 4 ignored**, strict Clippy/doc/fmt — PASS. Реальный Kitty GUI visual check показал red/blue pixels с сохранными borders. Isolated real-tmux server также показал halfblocks/RGB, оставил `allow-passthrough` unset и завершился чисто. iTerm2/Sixel не установлены/не проверены; structural tests не заявляются как их ручная acceptance matrix. + +## Change `fix-selection-preview-and-directory-icons` + +- Пользовательский реальный запуск выявил, что прежний fix скрывал loading только до deadline. Selection-origin running request теперь остаётся quiet до current response: никаких `LOADING PREVIEW`, `Reading…` или `NO PREVIEW`; initial/F3 loading не изменён. +- Directory preview получил typed bounded rows и semantic icons для вложенных generic/special folders и files; icons-off сохраняет имена. +- Новые regressions закрывают кадр после deadline и nested directory rows, включая U+2028/U+2029 sanitization. Полный suite: **652 passed, 0 failed, 4 ignored**; strict Clippy/fmt — PASS. Финальный independent verdict: **0 findings**; пользовательский visual verdict остаётся открытым. diff --git a/docs/spec-matrix.md b/docs/spec-matrix.md index ab19e11..bb5bd40 100644 --- a/docs/spec-matrix.md +++ b/docs/spec-matrix.md @@ -275,6 +275,15 @@ | file-navigation | Production PTY halfblocks и отсутствие substitute-tmux вызова | `tests/pty_smoke.rs::image_halfblocks_render_in_pty_without_calling_substitute_tmux` | | file-navigation | Config images и --no-images | `tests/appearance_config.rs::missing_config_uses_unicode_and_cli_overrides_without_a_write`, `every_documented_mode_is_parsed_and_unknown_fields_are_forward_compatible` | +## Change: fix-selection-preview-and-directory-icons + +| Capability | Scenario / contract | Текущие тесты | +|---|---|---| +| file-navigation | Selection-origin read остаётся quiet после deadline без LOADING/Reading/NO PREVIEW | `tests/preview_debounce.rs::rapid_selection_has_no_intermediate_read_or_loading_and_starts_once_at_40ms` | +| file-navigation | Initial/F3 loading сохраняется | `tests/preview_debounce.rs::initial_f3_and_pure_selection_effects_keep_their_distinct_modes`; `tests/ui_states.rs::loading_empty_error_and_stale_warning_are_distinct_states` | +| terminal-ui | Nested generic/special directory и file icons, icons-off | `tests/file_type_rendering.rs::directory_preview_shows_icons_for_nested_folders_and_files` | + + ## Change: redesign-help-and-remove-hints | Requirement | Scenario / contract | Текущие тесты | diff --git a/docs/testing.md b/docs/testing.md index 5b975e9..452b191 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -67,6 +67,9 @@ cargo test --test ssh_action_acceptance --locked -- --ignored --nocapture - `tests/preview_debounce.rs` использует explicit clock без sleeps: 39/40 ms, quiet full-Buffer/current title, отсутствие intermediate reads, один current request, все selection aliases/Repeat, initial/F3/background semantics, background completion/running/changed selection до и после deadline, dual source pending, failed navigation/connect и wrong generation/target/navigation/host при равных numeric epochs. `src/tui.rs::tests::preview_deadline_wakes_at_40ms_independently_of_redraw_ticks` использует paused Tokio clock для production `sleep_until` helper. - PTY `rapid_selection_burst_coalesces_preview_and_restores_terminal` подтверждает byte-level burst, итоговый target и terminal restore. Отсутствие промежуточных reads/loading доказывается детерминированными tests, а не одним подсчётом строки в diffed terminal output. `tests/ssh_connection.rs` дополнительно покрывает failed/wrong-host/superseded recovery с новой generation. +- `tests/preview_debounce.rs` дополнительно проверяет полный Buffer **после** запуска selection worker: `LOADING PREVIEW`, `Reading…` и `NO PREVIEW` остаются скрытыми до current response. Initial/F3 loading сохранён. +- `tests/file_type_rendering.rs::directory_preview_shows_icons_for_nested_folders_and_files` проверяет generic/special nested folders и file icons, а также `none` fallback. + ### Appearance config и icons - `tests/icon_resolver.rs` проверяет classification без filesystem/network I/O, precedence/case/type gating, metadata fallback, semantic classes и synthetic large listing. Glyph catalog attribution находится в `THIRD_PARTY_NOTICES.md`. diff --git a/openspec/changes/fix-selection-preview-and-directory-icons/design.md b/openspec/changes/fix-selection-preview-and-directory-icons/design.md new file mode 100644 index 0000000..cb28615 --- /dev/null +++ b/openspec/changes/fix-selection-preview-and-directory-icons/design.md @@ -0,0 +1,18 @@ +# Design + +## Decisions + +1. `PreviewState.selection_recovery` уже остаётся истинным от selection debounce через StartPreview до current response. Renderer использует его для quiet состояния: `debouncing || (loading && selection_recovery)`. Initial/F3 имеют `selection_recovery=false` и сохраняют loading. +2. Scheduler, requests и stale guards не меняются; исправляется только presentation после deadline. +3. `Preview` получает bounded typed `directory_entries` параллельно существующим sanitized lines. Renderer использует raw row только для IconResolver, а отображаемое имя берёт из соответствующей sanitized line через `zip`, включая U+2028/U+2029 escaping. +4. Icons-off возвращает пустой glyph и обычную текстовую строку. Image/text/binary paths не затрагиваются. + +## Tests + +- Полный Buffer после 40 ms: нет `LOADING PREVIEW`, `NO PREVIEW`, title текущий; итоговый response применяется. +- Directory rows: generic `📁`, `src` `💻`, text file `📄`; `none` сохраняет имена. +- Полный suite/Clippy/fmt/doc и отсутствие `.snap.new`. + +## Rollback + +Вернуть прежний loading renderer и текстовые directory lines; файловые данные не затрагиваются. diff --git a/openspec/changes/fix-selection-preview-and-directory-icons/proposal.md b/openspec/changes/fix-selection-preview-and-directory-icons/proposal.md new file mode 100644 index 0000000..0b72188 --- /dev/null +++ b/openspec/changes/fix-selection-preview-and-directory-icons/proposal.md @@ -0,0 +1,16 @@ +# Proposal + +## Why + +Selection debounce скрывал loading только до deadline; после запуска current request renderer снова показывал `LOADING PREVIEW`/`Reading…`, поэтому реальный key repeat всё ещё дёргал preview. Кроме того, содержимое directory preview оставалось текстовым даже при включённых icons. + +## What Changes + +- Для pending и running selection-origin preview показывать quiet область с текущим title без `LOADING PREVIEW`, `Reading…` или `NO PREVIEW` до current response. +- Сохранить loading для initial listing и ручного F3, не меняя scheduler/generation/epoch guards. +- Хранить typed directory rows в Preview и показывать semantic icons для вложенных каталогов/файлов в persistent/F3, включая icons-off fallback. + +## Impact + +- MODIFIED visual behavior, без filesystem/SSH protocol mutations. +- Новый regression проверяет кадр после deadline; directory test проверяет generic/special folders и files. diff --git a/openspec/changes/fix-selection-preview-and-directory-icons/specs/file-navigation/spec.md b/openspec/changes/fix-selection-preview-and-directory-icons/specs/file-navigation/spec.md new file mode 100644 index 0000000..a29b125 --- /dev/null +++ b/openspec/changes/fix-selection-preview-and-directory-icons/specs/file-navigation/spec.md @@ -0,0 +1,14 @@ +# Spec Delta + +## ADDED Requirements + +### Requirement: Тихий running selection preview +Система SHALL сохранять quiet preview не только во время selection debounce, но и после запуска selection-origin read до применения current response. Промежуточные loading/unavailable тексты MUST NOT появляться; initial/F3 semantics сохраняются. + +#### Scenario: Медленный selection request после deadline +- **WHEN** debounce истёк и selection-origin preview read ещё выполняется +- **THEN** title остаётся текущим, область пуста и не содержит `LOADING PREVIEW`, `Reading…` или `NO PREVIEW` + +#### Scenario: Initial или ручной F3 +- **WHEN** выполняется initial preview или пользователь явно открыл F3 +- **THEN** существующий foreground loading остаётся разрешённым и не заменяется selection-only quiet правилом diff --git a/openspec/changes/fix-selection-preview-and-directory-icons/specs/terminal-ui/spec.md b/openspec/changes/fix-selection-preview-and-directory-icons/specs/terminal-ui/spec.md new file mode 100644 index 0000000..0b0d80b --- /dev/null +++ b/openspec/changes/fix-selection-preview-and-directory-icons/specs/terminal-ui/spec.md @@ -0,0 +1,14 @@ +# Spec Delta + +## ADDED Requirements + +### Requirement: Иконки содержимого directory preview +Система SHALL показывать semantic icons для вложенных каталогов и файлов в persistent/F3 directory preview по тем же deterministic resolver rules, что и основной список. Специальный шрифт MUST NOT быть обязательным. + +#### Scenario: Вложенные каталоги и файлы +- **WHEN** directory preview содержит generic folder, известную folder name и обычный файл +- **THEN** строки содержат соответствующие generic/special/file icons и читаемые имена + +#### Scenario: Icons-off +- **WHEN** выбран `none` +- **THEN** содержимое directory preview остаётся читаемым без обязательных glyphs diff --git a/openspec/changes/fix-selection-preview-and-directory-icons/tasks.md b/openspec/changes/fix-selection-preview-and-directory-icons/tasks.md new file mode 100644 index 0000000..6c9d775 --- /dev/null +++ b/openspec/changes/fix-selection-preview-and-directory-icons/tasks.md @@ -0,0 +1,21 @@ +# Tasks + +## 1. Quiet running selection + +- [x] 1.1 Расширить quiet condition на `loading && selection_recovery`; regression после deadline запрещает `LOADING PREVIEW` и `NO PREVIEW`, сохраняя текущий title. +- [x] 1.2 Сохранить initial/F3 loading и существующие scheduler/stale/SSH tests. + +## 2. Directory preview icons + +- [x] 2.1 Добавить bounded typed directory rows и semantic renderer для nested folders/files без повторного parsing sanitized lines. +- [x] 2.2 Покрыть generic/special folder/file icons и icons-off. + +## 3. Приёмка + +- [x] 3.1 Прогнать fmt, strict Clippy, полный tests/doc suite и обновить traceability/acceptance. +- [x] 3.2 Получить независимый verify: финальный verdict 0 findings, включая running selection и sanitized directory rows. +- [ ] 3.3 Получить визуальный ответ пользователя по актуальному `cargo run --locked --`. + +## Workflow follow-up + +- После подтверждения синхронизировать ADDED requirements и архивировать change. diff --git a/src/app/mod.rs b/src/app/mod.rs index a6adcb0..84526bf 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1336,6 +1336,7 @@ impl AppState { format!("Reason: {}", result.result.unwrap_err()), ], truncated: false, + directory_entries: Vec::new(), }); pane.preview.encoded_image = None; } diff --git a/src/preview.rs b/src/preview.rs index d25f6af..b6562a7 100644 --- a/src/preview.rs +++ b/src/preview.rs @@ -40,6 +40,8 @@ pub struct Preview { pub kind: PreviewKind, pub lines: Vec, pub truncated: bool, + /// Typed directory rows used to render icons without reparsing sanitized display text. + pub directory_entries: Vec, } /// A bounded byte prefix. `bytes.len()` never exceeds the requested limit. @@ -142,6 +144,7 @@ pub fn text_preview(bytes: &[u8], truncated: bool) -> Preview { kind: PreviewKind::Text, lines, truncated, + directory_entries: Vec::new(), } } @@ -159,6 +162,7 @@ where kind: PreviewKind::Metadata, lines, truncated: false, + directory_entries: Vec::new(), } } @@ -174,6 +178,7 @@ where kind: PreviewKind::Binary, lines, truncated: false, + directory_entries: Vec::new(), } } @@ -224,6 +229,7 @@ where kind: PreviewKind::Directory, lines, truncated, + directory_entries: entries.clone(), } } diff --git a/src/ui/render.rs b/src/ui/render.rs index b8d90a7..188e6b5 100644 --- a/src/ui/render.rs +++ b/src/ui/render.rs @@ -15,7 +15,7 @@ use crate::app::{AppState, Clipboard, Overlay, PaneId, PaneMode, PaneState}; use crate::domain::{Entry, EntryKind, Location, SourceId}; use crate::image_preview::ImageRenderContext; use crate::operations::{OperationKind, WorkKind}; -use crate::preview::{Preview, TRUNCATION_MARKER}; +use crate::preview::{EntryPreview, Preview, PreviewKind, TRUNCATION_MARKER}; use crate::ssh::HostPickerState; use super::help::{HelpTabs, help_view_model}; @@ -614,7 +614,7 @@ fn render_preview( return; } - if pane.preview.debouncing { + if pane.preview.debouncing || (pane.preview.loading && pane.preview.selection_recovery) { frame.render_widget(Paragraph::new("").style(theme.panel()), inner); } else if pane.selected_entry().is_none() { render_message( @@ -665,6 +665,38 @@ fn render_preview( } } +fn directory_preview_line( + entry: &EntryPreview, + display_name: &str, + width: u16, + theme: &Theme, +) -> Line<'static> { + let kind = if entry.is_dir { + EntryKind::Directory + } else { + EntryKind::File + }; + let domain_entry = Entry::new(entry.name.clone(), kind); + let icon = theme.icon_resolver().resolve(&domain_entry); + let name = display_name; + let width = usize::from(width); + let glyph_width = UnicodeWidthStr::width(icon.glyph); + if glyph_width == 0 { + return Line::from(fit(name, width, theme.is_ascii())).style(theme.text()); + } + let name_width = width.saturating_sub(glyph_width + 1); + let name = if entry.is_dir { + truncate_middle(name, name_width, theme.is_ascii()) + } else { + truncate_filename(name, name_width, theme.is_ascii()) + }; + Line::from(vec![ + Span::styled(icon.glyph, theme.icon_style(&icon)), + Span::raw(" "), + Span::styled(name, theme.filename_style(icon.class)), + ]) +} + fn render_prepared_image( frame: &mut Frame, area: Rect, @@ -705,16 +737,28 @@ fn render_preview_content(frame: &mut Frame, area: Rect, preview: &Preview, them area.width, area.height.saturating_sub(footer_height), ); - let lines: Vec> = preview - .lines - .iter() - .filter(|line| !preview.truncated || line.as_str() != TRUNCATION_MARKER) - .take(usize::from(body.height)) - .map(|line| { - let safe = sanitize(line); - Line::from(fit(&safe, usize::from(body.width), theme.is_ascii())).style(theme.text()) - }) - .collect(); + let lines: Vec> = + if preview.kind == PreviewKind::Directory && !preview.directory_entries.is_empty() { + preview + .directory_entries + .iter() + .zip(preview.lines.iter()) + .take(usize::from(body.height)) + .map(|(entry, line)| directory_preview_line(entry, line, body.width, theme)) + .collect() + } else { + preview + .lines + .iter() + .filter(|line| !preview.truncated || line.as_str() != TRUNCATION_MARKER) + .take(usize::from(body.height)) + .map(|line| { + let safe = sanitize(line); + Line::from(fit(&safe, usize::from(body.width), theme.is_ascii())) + .style(theme.text()) + }) + .collect() + }; frame.render_widget(Paragraph::new(lines).style(theme.panel()), body); if footer_height > 0 { diff --git a/tests/app_preview.rs b/tests/app_preview.rs index ba3b6d8..c64d3ff 100644 --- a/tests/app_preview.rs +++ b/tests/app_preview.rs @@ -333,6 +333,7 @@ async fn unsupported_entry_uses_metadata_without_reading_contents() { "Type: Other".into(), ], truncated: false, + directory_entries: Vec::new(), }) ); } diff --git a/tests/file_type_rendering.rs b/tests/file_type_rendering.rs index a3afe3f..5426132 100644 --- a/tests/file_type_rendering.rs +++ b/tests/file_type_rendering.rs @@ -5,6 +5,7 @@ use ratatui::buffer::Buffer; use ratatui::style::Color; use rcom::app::{AppState, PaneId, PaneMode}; use rcom::domain::{Entry, EntryKind, Location}; +use rcom::preview::{EntryPreview, directory_preview}; use rcom::ui::{IconMode, Theme, render}; use unicode_width::UnicodeWidthStr; @@ -65,6 +66,43 @@ fn text_position(buffer: &Buffer, needle: &str) -> (u16, u16) { .unwrap_or_else(|| panic!("missing {needle}:\n{}", buffer_text(buffer))) } +#[test] +fn directory_preview_shows_icons_for_nested_folders_and_files() { + let mut app = canonical_app(); + app.active_pane_mut().selection.set(Some(0), 6); + app.active_pane_mut().preview.content = Some(directory_preview([ + EntryPreview::new("nested", true), + EntryPreview::new("src", true), + EntryPreview::new("notes.txt", false), + EntryPreview::new("bad\u{2028}\u{2029}", true), + ])); + let buffer = draw(&app, 140, 30, &Theme::night_ops()); + let text = buffer_text(&buffer); + for expected in ["📁 nested/", "💻 src/", "📄 notes.txt"] { + assert!(text.contains(expected), "missing {expected}:\n{text}"); + } + assert!(text.contains(r"bad\u{2028}\u{2029}/"), "{text}"); + assert!( + !text.contains('\u{2028}') && !text.contains('\u{2029}'), + "{text}" + ); + + let fallback = draw( + &app, + 140, + 30, + &Theme::night_ops().with_icon_mode(IconMode::None), + ); + let fallback = buffer_text(&fallback); + assert!(fallback.contains("nested/")); + assert!(!fallback.contains("📁 nested/")); + assert!(fallback.contains(r"bad\u{2028}\u{2029}/"), "{fallback}"); + assert!( + !fallback.contains('\u{2028}') && !fallback.contains('\u{2029}'), + "{fallback}" + ); +} + #[test] fn canonical_night_ops_fixture_separates_icons_names_and_selected_marked_state() { let app = canonical_app(); diff --git a/tests/image_runtime.rs b/tests/image_runtime.rs index 329ddbe..aae71e7 100644 --- a/tests/image_runtime.rs +++ b/tests/image_runtime.rs @@ -116,6 +116,7 @@ fn install_current_image(app: &mut Application, pane: PaneId, name: &str) { kind: PreviewKind::Image, lines: vec!["Preparing".into()], truncated: false, + directory_entries: Vec::new(), }); state.panes[pane.index()].preview.encoded_image = Some(EncodedImage { bytes: Arc::new(png()), @@ -344,6 +345,7 @@ async fn background_image_refresh_prepares_accepted_new_bytes_instead_of_old_gen kind: PreviewKind::Image, lines: vec!["Changed image".into()], truncated: false, + directory_entries: Vec::new(), })); response.encoded_image = Some(EncodedImage { bytes: Arc::new(changed_png()), diff --git a/tests/live_refresh_ui.rs b/tests/live_refresh_ui.rs index 6da16c4..c1b16cc 100644 --- a/tests/live_refresh_ui.rs +++ b/tests/live_refresh_ui.rs @@ -132,6 +132,7 @@ fn preview_app() -> AppState { kind: PreviewKind::Text, lines: vec!["1 │ stable preview".into()], truncated: false, + directory_entries: Vec::new(), }); app } @@ -169,6 +170,7 @@ fn background_preview_keeps_the_same_file_frame_and_atomically_applies_changes() kind: PreviewKind::Text, lines: vec!["1 │ changed preview".into()], truncated: false, + directory_entries: Vec::new(), })))); let after = text(&draw_size(&app, 140, 30)); assert!(after.contains("changed preview")); diff --git a/tests/preview_debounce.rs b/tests/preview_debounce.rs index 68711d3..5c6e8fc 100644 --- a/tests/preview_debounce.rs +++ b/tests/preview_debounce.rs @@ -77,6 +77,7 @@ async fn rapid_selection_has_no_intermediate_read_or_loading_and_starts_once_at_ kind: PreviewKind::Text, lines: vec!["stale-old-preview".into()], truncated: false, + directory_entries: Vec::new(), }); app.dispatch_at(Command::MoveSelection(1), start); assert_eq!(app.pending_preview_count(), 1); @@ -110,6 +111,10 @@ async fn rapid_selection_has_no_intermediate_read_or_loading_and_starts_once_at_ assert_eq!(app.pending_preview_count(), 0); assert!(app.state().panes[0].preview.loading); assert!(!app.state().panes[0].preview.debouncing); + let running = draw(&app); + assert!(!running.contains("LOADING PREVIEW"), "{running}"); + assert!(!running.contains("NO PREVIEW"), "{running}"); + assert!(preview_title(&draw_buffer(&app)).contains("c.txt")); let completed = tokio::time::timeout(Duration::from_secs(1), results.recv()) .await diff --git a/tests/theme_rendering.rs b/tests/theme_rendering.rs index ef28414..da9956c 100644 --- a/tests/theme_rendering.rs +++ b/tests/theme_rendering.rs @@ -44,6 +44,7 @@ fn rich_app() -> AppState { kind: PreviewKind::Text, lines: vec!["1 │ preview text".into(), "2 │ selected state".into()], truncated: true, + directory_entries: Vec::new(), }); app } diff --git a/tests/ui_hardening.rs b/tests/ui_hardening.rs index d4b6902..96cf6dc 100644 --- a/tests/ui_hardening.rs +++ b/tests/ui_hardening.rs @@ -44,6 +44,7 @@ fn preview_app(kind: PreviewKind) -> AppState { kind, lines, truncated: true, + directory_entries: Vec::new(), }); app } diff --git a/tests/ui_layout.rs b/tests/ui_layout.rs index 995a3f5..d2f84ae 100644 --- a/tests/ui_layout.rs +++ b/tests/ui_layout.rs @@ -36,6 +36,7 @@ fn sample_app(mode: PaneMode) -> AppState { "3 │ Safe, bounded text preview.".to_owned(), ], truncated: false, + directory_entries: Vec::new(), }); app.panes[1] = app.panes[0].clone(); app.panes[1].location = Location::ssh(HostAlias::new("edge-prod"), "/srv/releases"); diff --git a/tests/ui_overlays.rs b/tests/ui_overlays.rs index 6801830..1631a52 100644 --- a/tests/ui_overlays.rs +++ b/tests/ui_overlays.rs @@ -21,6 +21,7 @@ fn sample_app(mode: PaneMode) -> AppState { "3 │ The underlying panes keep their geometry.".to_owned(), ], truncated: false, + directory_entries: Vec::new(), }); app.panes[1] = app.panes[0].clone(); app.panes[1].location = Location::ssh(HostAlias::new("edge-prod"), "/srv/releases"); diff --git a/tests/ui_states.rs b/tests/ui_states.rs index 3a369f2..fae384f 100644 --- a/tests/ui_states.rs +++ b/tests/ui_states.rs @@ -33,6 +33,7 @@ fn app_with_entries() -> AppState { "2 │ Read-only workspace".to_owned(), ], truncated: false, + directory_entries: Vec::new(), }); app }