feat: add optional feature flags for clipboard and url-open (P5.15)

Implemented feature flags to make dependencies optional:
- clipboard feature: controls arboard dependency
- url-open feature: controls open dependency
- Both enabled by default for backward compatibility

Changes:
- Cargo.toml: Added [features] section with optional deps
- src/input/main_input.rs: Conditional compilation for open::that() and copy_to_clipboard()
- tests/copy.rs: Clipboard tests only compile with feature enabled
- Graceful degradation: user-friendly error messages when features disabled

Benefits:
- Smaller binary size when features disabled
- Modular functionality
- Better platform compatibility

Progress: Priority 5: 1/3 tasks, Total: 17/20 (85%)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Mikhail Kilin
2026-02-01 02:23:17 +03:00
parent 38b18e35ea
commit 56bddabbe1
5 changed files with 63 additions and 22 deletions

View File

@@ -111,7 +111,7 @@ fn format_message_for_test(msg: &tele_tui::tdlib::MessageInfo) -> String {
result
}
#[cfg(test)]
#[cfg(all(test, feature = "clipboard"))]
mod clipboard_tests {
use super::*;