Mikhail Kilin
78fe09bf11
feat: implement photo albums (media groups) and persist account selection
...
Group photos with shared media_album_id into single album bubbles with
grid layout (up to 3x cols). Album navigation treats grouped photos as
one unit (j/k skip entire album). Persist selected account to
accounts.toml so it survives app restart.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-22 16:18:04 +03:00
Mikhail Kilin
6639dc876c
fixes
2026-02-13 19:52:53 +03:00
Mikhail Kilin
8a467b6418
feat: complete Phase 12 — voice playback ticker, cache, config, and UI
...
Add playback position ticker in event loop with 1s UI refresh rate,
integrate VoiceCache for downloaded voice files, add [audio] config
section (cache_size_mb, auto_download_voice), and render progress bar
with waveform visualization in message bubbles.
Fix race conditions in AudioPlayer: add `starting` flag to prevent
false `is_stopped()` during ffplay startup, guard pid cleanup so old
threads don't overwrite newer process pids. Implement `resume_from()`
with ffplay `-ss` for real audio seek on unpause (-1s rewind).
Kill ffplay on app exit via `stop_playback()` in shutdown + Drop impl.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-09 16:37:02 +03:00
Mikhail Kilin
2a5fd6aa35
perf: optimize Phase 11 image rendering with dual-protocol architecture
...
Redesigned UX and performance for inline photo viewing:
UX changes:
- Always-show inline preview (fixed 50 chars width)
- Fullscreen modal on 'v' key with ←/→ navigation between photos
- Loading indicator "⏳ Загрузка..." in modal for first view
- ImageModalState type for modal state management
Performance optimizations:
- Dual renderer architecture:
* inline_image_renderer: Halfblocks protocol (fast, Unicode blocks)
* modal_image_renderer: iTerm2/Sixel protocol (high quality)
- Frame throttling: inline images 15 FPS (66ms), text remains 60 FPS
- Lazy loading: only visible images loaded (was: all images)
- LRU cache: max 100 protocols with eviction
- Skip partial rendering to prevent image shrinking/flickering
Technical changes:
- App: added inline_image_renderer, modal_image_renderer, last_image_render_time
- ImageRenderer: new() for modal (auto-detect), new_fast() for inline (Halfblocks)
- messages.rs: throttled second-pass rendering, visible-only loading
- modals/image_viewer.rs: NEW fullscreen modal with loading state
- ImagesConfig: added inline_image_max_width, auto_download_images
Result: 10x faster navigation, smooth 60 FPS text, quality modal viewing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-08 01:36:36 +03:00
Mikhail Kilin
b0f1f9fdc2
feat: implement Phase 11 — inline photo viewing with ratatui-image
...
Add feature-gated (`images`) inline photo support:
- New types: MediaInfo, PhotoInfo, PhotoDownloadState, ImagesConfig
- Media module: ImageCache (LRU filesystem cache), ImageRenderer (terminal protocol detection)
- Photo metadata extraction from TDLib MessagePhoto with download_file() API
- ViewImage command (v/м) to toggle photo expand/collapse in message selection
- Two-pass UI rendering: placeholder lines in message bubbles + StatefulImage overlay
- Collapse all expanded photos on Esc (exit selection mode)
Dependencies: ratatui-image 8.1, image 0.25 (optional, behind `images` feature flag)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-06 21:25:17 +03:00
Mikhail Kilin
ed5a4f9c72
refactor: complete UI components - implement message_bubble.rs
...
CI / Check (pull_request) Has been cancelled
CI / Format (pull_request) Has been cancelled
CI / Clippy (pull_request) Has been cancelled
CI / Build (macos-latest) (pull_request) Has been cancelled
CI / Build (ubuntu-latest) (pull_request) Has been cancelled
CI / Build (windows-latest) (pull_request) Has been cancelled
Finalize Priority 3 UI components refactoring (5/5 complete):
- Create message_bubble.rs (437 lines) with 3 rendering functions:
* render_date_separator() - centered date separators
* render_sender_header() - sender headers (incoming/outgoing)
* render_message_bubble() - messages with forward/reply/reactions
- Simplify messages.rs by removing ~300 lines:
* Use message_grouping::group_messages() for logic
* Use UI components for rendering
* Cleaner separation of concerns
- Update module exports and main.rs
All 196 tests passing (188 tests + 8 benchmarks). No regressions.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-02-02 03:41:03 +03:00
Mikhail Kilin
2b04b785c0
refactor: cleanup unused code and warnings
...
CI / Check (pull_request) Has been cancelled
CI / Format (pull_request) Has been cancelled
CI / Clippy (pull_request) Has been cancelled
CI / Build (macos-latest) (pull_request) Has been cancelled
CI / Build (ubuntu-latest) (pull_request) Has been cancelled
CI / Build (windows-latest) (pull_request) Has been cancelled
Comprehensive cleanup of unused methods, dead code, and compiler warnings:
## Removed Methods (15):
- Duplicate delegation methods: is_authenticated, get_typing_text, get_user_name from TdClient
- Obsolete methods: TdClient::init() (duplicated in main.rs)
- Unused getters: UserCache::{get_username, get_name, get_user_id_by_chat}
- Unused builder methods: MessageBuilder::{edited, add_reaction}
- Unused utility: ChatState::is_normal()
- Dead code: HotkeysConfig::{matches, key_matches} (kept for tests)
- Unused method: UserCache::register_private_chat()
- Getter replaced with direct field access: MessageInfo::edit_date()
## Removed Module:
- error.rs - Unused error handling module (TeletuiError, ErrorVariant, IntoTeletuiError)
## Removed Constants (8):
- EMOJI_PICKER_COLUMNS, EMOJI_PICKER_ROWS, MAX_INPUT_HEIGHT
- MIN_TERMINAL_WIDTH, MIN_TERMINAL_HEIGHT
- TDLIB_CHAT_LIMIT, MAX_USERNAME_DISPLAY_LENGTH, MESSAGE_TEXT_INDENT
## Fixed Warnings:
- Removed unused imports (8 instances)
- Fixed unreachable patterns (10 instances)
- Fixed irrefutable if let patterns (2 instances)
- Fixed unused variables (1 instance)
- Removed dead_code annotations where appropriate
## Improvements:
- Integrated Config::load_credentials() into TdClient::new() for better credential management
- Replaced edit_date() getter with direct field access (message.metadata.edit_date)
- Updated tests to use direct field access instead of removed getters
## Test Results:
All tests passing: 499 passed, 0 failed
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-02-01 18:57:55 +03:00
Mikhail Kilin
644e36597d
fixes
2026-01-31 03:48:50 +03:00