repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/news/fetch.rs | src/sources/news/fetch.rs | //! News fetching functionality with HTTP client and error handling.
use crate::sources::news::cache::{ARTICLE_CACHE, ARTICLE_CACHE_TTL_SECONDS, ArticleCacheEntry};
use crate::sources::news::parse::parse_arch_news_html;
use crate::sources::news::utils::is_archlinux_url;
use crate::sources::news::{
aur::extract_aur... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/news/utils.rs | src/sources/news/utils.rs | //! Utility functions for news parsing and URL handling.
/// What: Return the substring strictly between `start` and `end` markers (if present).
///
/// Input: `s` source text; `start` opening marker; `end` closing marker
/// Output: `Some(String)` of enclosed content; `None` if markers are missing
///
/// Details: Se... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/news/tests_aur.rs | src/sources/news/tests_aur.rs | //! AUR-related tests for news module.
use crate::sources::news::aur::{extract_aur_pkg_from_url, render_aur_comments};
#[test]
/// What: Test `extract_aur_pkg_from_url` identifies AUR package URLs.
///
/// Inputs:
/// - Various AUR package URL formats.
///
/// Output:
/// - Package name extracted correctly from URL.
... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/news/mod.rs | src/sources/news/mod.rs | //! Arch Linux news fetching and parsing.
mod aur;
mod cache;
mod fetch;
mod parse;
mod utils;
/// Result type alias for Arch Linux news fetching operations.
type Result<T> = super::Result<T>;
pub use fetch::{fetch_arch_news, fetch_news_content};
pub use parse::parse_arch_news_html;
/// What: Parse raw news/advisor... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/news/aur.rs | src/sources/news/aur.rs | //! AUR-related functionality for news module.
use crate::sources::news::parse::collapse_blank_lines;
/// What: Extract package name from an AUR package URL.
///
/// Inputs:
/// - `url`: URL to inspect.
///
/// Output:
/// - `Some(pkgname)` if the URL matches `https://aur.archlinux.org/packages/<name>`
/// or offic... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/news/cache.rs | src/sources/news/cache.rs | //! Cache management for article content.
use std::collections::HashMap;
use std::sync::{LazyLock, Mutex};
use std::time::Instant;
use tracing::{debug, info, warn};
/// Cache entry for article content with timestamp.
pub struct ArticleCacheEntry {
/// Cached article content.
pub content: String,
/// Times... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/status/html.rs | src/sources/status/html.rs | use crate::state::ArchStatusColor;
use super::utils::{
extract_arch_systems_status_color, extract_aur_today_percent, extract_aur_today_rect_color,
extract_status_updates_today_color, severity_max, today_ymd_utc,
};
/// What: Check if AUR specifically shows "Down" status in the monitors section.
///
/// Inputs... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/status/api.rs | src/sources/status/api.rs | use crate::state::ArchStatusColor;
use std::fmt::Write;
use super::utils::{severity_max, today_ymd_utc};
/// Parse the `UptimeRobot` API response to extract the worst status among all monitors (AUR, Forum, Website, Wiki).
///
/// Inputs:
/// - `v`: JSON value from <https://status.archlinux.org/api/getMonitorList/vmM5... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/status/translate.rs | src/sources/status/translate.rs | use crate::state::AppState;
/// What: Extract AUR suffix information from remaining text after a service ratio.
///
/// Inputs:
/// - `remaining`: Text remaining after extracting service ratio
///
/// Output:
/// - `(Option<u32>, Option<f64>)` tuple with AUR percentage and ratio if found
fn extract_aur_suffix(remainin... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/status/utils.rs | src/sources/status/utils.rs | use crate::state::ArchStatusColor;
/// What: Check for "Status: Arch systems..." pattern and detect if "Some Systems down" or "Down" is shown.
///
/// Inputs:
/// - `body`: Raw HTML content to analyze.
///
/// Output:
/// - `Some(ArchStatusColor)` if "Some Systems down" or "Down" is detected in the status context, `No... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/status/mod.rs | src/sources/status/mod.rs | //! Arch Linux status page parsing and monitoring.
use crate::state::ArchStatusColor;
use std::fmt::Write;
/// Status API parsing (`Statuspage` and `UptimeRobot` APIs).
mod api;
/// HTML parsing for status page.
mod html;
/// Translation utilities for status messages.
pub mod translate;
/// Utility functions for stat... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/feeds/rate_limit.rs | src/sources/feeds/rate_limit.rs | //! Rate limiting and circuit breaker for network requests.
use std::collections::HashMap;
use std::sync::{LazyLock, Mutex};
use std::time::{Duration, Instant};
use rand::Rng;
use tracing::{debug, warn};
use super::Result;
/// Rate limiter for news feed network requests.
/// Tracks the last request time to enforce m... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/feeds/tests.rs | src/sources/feeds/tests.rs | //! Tests for news feed functionality.
use crate::state::types::{AdvisorySeverity, AurComment, NewsFeedSource};
use std::collections::HashMap;
use super::cache::{CACHE_TTL_SECONDS, CacheEntry, DiskCacheEntry, disk_cache_ttl_seconds};
use super::helpers::{
build_official_update_item, extract_date_from_pkg_json, nor... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/feeds/helpers.rs | src/sources/feeds/helpers.rs | //! Helper functions for building feed items, date parsing, and utilities.
use std::collections::HashMap;
use std::fs;
use std::hash::BuildHasher;
use std::path::PathBuf;
use chrono::{DateTime, Utc};
use serde_json::Value;
use crate::state::types::{AurComment, NewsFeedItem, NewsFeedSource};
use crate::util::parse_upd... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/feeds/mod.rs | src/sources/feeds/mod.rs | //! Aggregated news feed fetcher (Arch news + security advisories).
mod cache;
mod helpers;
mod news_fetch;
mod rate_limit;
mod updates;
use std::collections::{HashMap, HashSet};
use std::hash::BuildHasher;
use std::path::PathBuf;
use crate::state::types::{NewsFeedItem, NewsSortMode, severity_rank};
use tracing::{inf... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/feeds/updates.rs | src/sources/feeds/updates.rs | //! Package updates fetching (official and AUR).
use std::collections::{HashMap, HashSet};
use std::hash::BuildHasher;
use std::path::PathBuf;
use std::sync::{LazyLock, Mutex};
use std::time::Instant;
use futures::stream::{self, StreamExt};
use serde_json::Value;
use tracing::{debug, info, warn};
use crate::state::ty... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/feeds/cache.rs | src/sources/feeds/cache.rs | //! Cache management for news feeds (in-memory and disk).
use std::collections::HashMap;
use std::sync::{LazyLock, Mutex};
use std::time::Instant;
use crate::state::types::NewsFeedItem;
use tracing::{debug, info, warn};
/// Cache entry with data and timestamp (in-memory).
pub(super) struct CacheEntry {
/// Cached... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/feeds/news_fetch.rs | src/sources/feeds/news_fetch.rs | //! News and advisories fetching with caching.
use std::collections::HashSet;
use std::hash::BuildHasher;
use std::time::{Duration, Instant};
use crate::state::types::{NewsFeedItem, NewsFeedSource};
use tracing::{info, warn};
use super::Result;
use super::cache::{
CACHE_TTL_SECONDS, CacheEntry, NEWS_CACHE, load_f... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/persist.rs | src/app/persist.rs | use std::fs;
use super::deps_cache;
use super::files_cache;
use super::sandbox_cache;
use super::services_cache;
use crate::state::AppState;
/// What: Persist the details cache to disk if marked dirty.
///
/// Inputs:
/// - `app`: Application state whose `details_cache` and `cache_path` are used
///
/// Output:
/// -... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/deps_cache.rs | src/app/deps_cache.rs | //! Dependency cache persistence for install list dependencies.
use crate::state::modal::DependencyInfo;
use serde::{Deserialize, Serialize};
use std::fs;
use std::io::ErrorKind;
use std::path::PathBuf;
/// What: Cache blob combining install list signature with resolved dependency graph.
///
/// Details:
/// - `insta... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/files_cache.rs | src/app/files_cache.rs | //! File cache persistence for install list file changes.
use crate::state::modal::PackageFileInfo;
use serde::{Deserialize, Serialize};
use std::fs;
use std::io::ErrorKind;
use std::path::PathBuf;
/// What: Cache blob combining install list signature with resolved file change metadata.
///
/// Details:
/// - `instal... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/terminal.rs | src/app/terminal.rs | use crossterm::{
event::{DisableMouseCapture, EnableMouseCapture},
execute,
terminal::{EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode},
};
/// Result type alias for terminal operations.
type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync>>;
/// Wh... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/mod.rs | src/app/mod.rs | //! Pacsea application module (split from a single large file into submodules).
//!
//! This module organizes the TUI runtime into smaller files to improve
//! maintainability and keep individual files under 500 lines.
/// Dependency cache for storing resolved dependency information.
mod deps_cache;
/// File cache for... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/sandbox_cache.rs | src/app/sandbox_cache.rs | //! Sandbox cache persistence for install list sandbox analysis.
use crate::logic::sandbox::SandboxInfo;
use serde::{Deserialize, Serialize};
use std::fs;
use std::io::ErrorKind;
use std::path::PathBuf;
/// What: Cache blob combining install list signature with resolved sandbox metadata.
///
/// Details:
/// - `insta... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/recent.rs | src/app/recent.rs | use std::time::{Duration, Instant};
use crate::state::AppState;
use crate::state::app_state::recent_capacity;
/// What: Debounced persistence of the current search input into the Recent list.
///
/// Inputs:
/// - `app`: Mutable application state providing the input text and timing markers
///
/// Output:
/// - Updat... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/services_cache.rs | src/app/services_cache.rs | //! Service cache persistence for install list service impacts.
use crate::state::modal::ServiceImpact;
use serde::{Deserialize, Serialize};
use std::fs;
use std::io::ErrorKind;
use std::path::PathBuf;
/// What: Cache blob combining install list signature with resolved service impact metadata.
///
/// Details:
/// - ... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/tick_handler.rs | src/app/runtime/tick_handler.rs | use std::fmt::Write;
use std::time::Instant;
use tokio::sync::mpsc;
use tokio::time::Duration;
use crate::logic::send_query;
use crate::state::{AppState, ArchStatusColor, PackageItem, QueryInput};
use super::super::persist::{
maybe_flush_announcement_read, maybe_flush_cache, maybe_flush_deps_cache,
maybe_flu... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/channels.rs | src/app/runtime/channels.rs | use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use crossterm::event::Event as CEvent;
use tokio::sync::mpsc;
use crate::state::types::NewsFeedPayload;
use crate::state::{ArchStatusColor, PackageDetails, PackageItem, QueryInput, SearchResults};
/// What: Channel definitions for runtime communication.
///
/// ... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/mod.rs | src/app/runtime/mod.rs | use ratatui::{Terminal, backend::CrosstermBackend};
use crate::logic::send_query;
use crate::state::AppState;
use super::terminal::{restore_terminal, setup_terminal};
/// Background worker management and spawning.
mod background;
/// Channel definitions for runtime communication.
mod channels;
/// Cleanup operations... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/init.rs | src/app/runtime/init.rs | use std::{collections::HashMap, fs, path::Path, time::Instant};
use crate::index as pkgindex;
use crate::state::{AppState, PackageDetails, PackageItem};
use super::super::deps_cache;
use super::super::files_cache;
use super::super::sandbox_cache;
use super::super::services_cache;
/// What: Initialize the locale syst... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/cleanup.rs | src/app/runtime/cleanup.rs | use crate::state::AppState;
use super::super::persist::{
maybe_flush_announcement_read, maybe_flush_cache, maybe_flush_deps_cache,
maybe_flush_files_cache, maybe_flush_install, maybe_flush_news_bookmarks,
maybe_flush_news_content_cache, maybe_flush_news_read, maybe_flush_news_read_ids,
maybe_flush_news... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/event_loop.rs | src/app/runtime/event_loop.rs | use ratatui::Terminal;
use tokio::select;
use crate::i18n;
use crate::state::types::NewsFeedPayload;
use crate::state::{AppState, PackageItem};
use crate::ui::ui;
use crate::util::parse_update_entry;
use tracing::info;
use super::background::Channels;
use super::handlers::{
handle_add_to_install_list, handle_depe... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/background.rs | src/app/runtime/background.rs | pub use crate::app::runtime::channels::Channels;
pub use crate::app::runtime::workers::auxiliary::{spawn_auxiliary_workers, spawn_event_thread};
| rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/workers/comments.rs | src/app/runtime/workers/comments.rs | //! Background worker for fetching AUR package comments.
use tokio::sync::mpsc;
use crate::sources;
use crate::state::types::AurComment;
/// What: Spawn background worker for AUR comments fetching.
///
/// Inputs:
/// - `comments_req_rx`: Channel receiver for comments requests (package name as String)
/// - `comment... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/workers/preflight.rs | src/app/runtime/workers/preflight.rs | use tokio::sync::mpsc;
use crate::state::PackageItem;
/// What: Spawn background worker for dependency resolution.
///
/// Inputs:
/// - `deps_req_rx`: Channel receiver for dependency resolution requests (with action)
/// - `deps_res_tx`: Channel sender for dependency resolution responses
///
/// Details:
/// - Runs ... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/workers/search.rs | src/app/runtime/workers/search.rs | use std::collections::HashSet;
use std::path::Path;
use std::time::Instant;
use tokio::{
select,
sync::mpsc,
time::{Duration, sleep},
};
use crate::index as pkgindex;
use crate::sources;
use crate::state::{PackageItem, QueryInput, SearchResults};
use crate::util::{fuzzy_match_rank_with_matcher, match_rank... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/workers/updates_parsing.rs | src/app/runtime/workers/updates_parsing.rs | /// What: Parse packages from pacman -Qu output.
///
/// Inputs:
/// - `output`: Raw command output bytes
///
/// Output:
/// - Vector of (`package_name`, `old_version`, `new_version`) tuples
///
/// Details:
/// - Parses `"package-name old_version -> new_version"` format
pub fn parse_checkupdates(output: &[u8]) -> Vec... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/workers/executor.rs | src/app/runtime/workers/executor.rs | //! Background worker for executing commands via PTY.
use tokio::sync::mpsc;
use crate::install::{ExecutorOutput, ExecutorRequest};
#[cfg(not(target_os = "windows"))]
use crate::install::{
build_downgrade_command_for_executor, build_install_command_for_executor,
build_remove_command_for_executor, build_scan_c... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/workers/mod.rs | src/app/runtime/workers/mod.rs | /// Auxiliary background workers (status, news, tick, index updates).
pub mod auxiliary;
/// AUR comments fetching worker.
pub mod comments;
/// Package details fetching worker.
pub mod details;
/// Package installation/removal executor worker.
pub mod executor;
/// News feed filtering and worker functions.
pub mod new... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/workers/updates_helpers.rs | src/app/runtime/workers/updates_helpers.rs | /// What: Check which AUR helper is available (paru or yay).
///
/// Output:
/// - Tuple of (`has_paru`, `has_yay`, `helper_name`)
pub fn check_aur_helper() -> (bool, bool, &'static str) {
use std::process::{Command, Stdio};
let has_paru = Command::new("paru")
.args(["--version"])
.stdin(Stdio:... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/workers/auxiliary.rs | src/app/runtime/workers/auxiliary.rs | use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use crossterm::event::Event as CEvent;
use tokio::sync::mpsc;
use tokio::sync::oneshot;
use tokio::time::{Duration, sleep};
use crate::index as pkgindex;
use crate::sources;
use crate::state::ArchStatusColor;
use crate::app::runtime::workers::news;
use crate::ap... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/workers/details.rs | src/app/runtime/workers/details.rs | use tokio::sync::mpsc;
use tokio::time::{Duration, sleep};
use crate::sources;
use crate::sources::fetch_details;
use crate::state::{PackageDetails, PackageItem, Source};
/// What: Spawn background worker for batched package details fetching.
///
/// Inputs:
/// - `net_err_tx`: Channel sender for network errors
/// -... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/workers/news.rs | src/app/runtime/workers/news.rs | use std::collections::HashSet;
use rand::Rng;
use tokio::{sync::mpsc, sync::oneshot, time::Duration};
use crate::index as pkgindex;
use crate::sources;
use crate::state::types::{NewsFeedSource, NewsSortMode};
/// What: Ensures installed packages set is populated, refreshing caches if needed.
///
/// Inputs:
/// - `i... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/workers/updates.rs | src/app/runtime/workers/updates.rs | use std::sync::OnceLock;
use tokio::sync::mpsc;
use crate::app::runtime::workers::updates_helpers::check_aur_helper;
#[cfg(not(target_os = "windows"))]
use crate::app::runtime::workers::updates_helpers::{
has_checkupdates, has_fakeroot, setup_temp_db, sync_temp_db,
};
use crate::app::runtime::workers::updates_pars... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/workers/news_content.rs | src/app/runtime/workers/news_content.rs | //! Background worker for fetching news article content.
use std::time::Instant;
use tokio::sync::mpsc;
use crate::sources;
/// What: Spawn background worker for news article content fetching.
///
/// Inputs:
/// - `news_content_req_rx`: Channel receiver for content requests (URL as String)
/// - `news_content_res_t... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/handlers/services.rs | src/app/runtime/handlers/services.rs | use tokio::sync::mpsc;
use crate::app::runtime::handlers::common::{HandlerConfig, handle_result};
use crate::state::AppState;
/// What: Handler configuration for service results.
struct ServiceHandlerConfig;
impl HandlerConfig for ServiceHandlerConfig {
type Result = crate::state::modal::ServiceImpact;
fn g... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/handlers/sandbox.rs | src/app/runtime/handlers/sandbox.rs | use tokio::sync::mpsc;
use crate::state::AppState;
/// What: Log detailed dependency information for `SandboxInfo` entries.
///
/// Inputs:
/// - `sandbox_info`: `SandboxInfo` resolution results to log
///
/// Output: None (side effect: logging)
///
/// Details:
/// - Logs summary and per-package dependency counts
fn... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/handlers/search.rs | src/app/runtime/handlers/search.rs | use tokio::sync::mpsc;
use crate::state::{AppState, PackageDetails, PackageItem, SearchResults, Source};
/// What: Handle search results update event.
///
/// Inputs:
/// - `app`: Application state
/// - `new_results`: New search results
/// - `details_req_tx`: Channel sender for detail requests
/// - `index_notify_t... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/handlers/install.rs | src/app/runtime/handlers/install.rs | use tokio::sync::mpsc;
use crate::app::runtime::handlers::common::{HandlerConfig, handle_result};
use crate::logic::add_to_install_list;
use crate::state::{AppState, PackageItem};
/// What: Handle add to install list event (single item).
///
/// Inputs:
/// - `app`: Application state
/// - `item`: Package item to add... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/handlers/mod.rs | src/app/runtime/handlers/mod.rs | /// Common utilities for channel handlers.
mod common;
/// Handler for file analysis results.
pub mod files;
/// Handler for install list and dependency results.
pub mod install;
/// Handler for sandbox analysis results.
pub mod sandbox;
/// Handler for search results and details updates.
pub mod search;
/// Handler f... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/handlers/files.rs | src/app/runtime/handlers/files.rs | use tokio::sync::mpsc;
use crate::app::runtime::handlers::common::{HandlerConfig, handle_result};
use crate::state::AppState;
/// What: Handler configuration for file results.
struct FileHandlerConfig;
impl HandlerConfig for FileHandlerConfig {
type Result = crate::state::modal::PackageFileInfo;
fn get_reso... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/app/runtime/handlers/common.rs | src/app/runtime/handlers/common.rs | //! Common handler infrastructure for result processing.
//!
//! This module provides a generic trait-based system for handling resolution results
//! with shared cancellation, flag management, and cache update logic.
use tokio::sync::mpsc;
use crate::state::AppState;
/// What: Configuration for a result handler tha... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/i18n/translations.rs | src/i18n/translations.rs | //! Translation map and lookup utilities.
use std::collections::HashMap;
/// Translation map: dot-notation key -> translated string.
pub type TranslationMap = HashMap<String, String>;
/// What: Look up a translation in the translation map.
///
/// Inputs:
/// - `key`: Dot-notation key (e.g., "app.titles.search")
///... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/i18n/mod.rs | src/i18n/mod.rs | //! Internationalization (i18n) module for Pacsea.
//!
//! This module provides locale detection, resolution, loading, and translation lookup.
//!
//! # Overview
//!
//! The i18n system supports:
//! - **Locale Detection**: Auto-detects system locale from environment variables (`LANG`, `LC_ALL`, `LC_MESSAGES`)
//! - **... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/i18n/loader.rs | src/i18n/loader.rs | //! Locale file loading and parsing.
use std::collections::HashMap;
use std::fs;
use std::path::{Path, PathBuf};
use crate::i18n::translations::TranslationMap;
/// What: Load a locale YAML file and parse it into a `TranslationMap`.
///
/// Inputs:
/// - `locale`: Locale code (e.g., "de-DE")
/// - `locales_dir`: Path... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/i18n/resolver.rs | src/i18n/resolver.rs | //! Locale resolution with fallback chain support.
use std::collections::HashMap;
use std::fs;
use std::path::PathBuf;
use crate::i18n::detection::detect_system_locale;
/// What: Resolve the effective locale to use, following fallback chain.
///
/// Inputs:
/// - `settings_locale`: Locale from settings.conf (empty s... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/i18n/detection.rs | src/i18n/detection.rs | //! System locale detection utilities.
use std::env;
/// What: Detect system locale from environment variables.
///
/// Inputs:
/// - None (reads from environment)
///
/// Output:
/// - `Option<String>` containing locale code (e.g., "de-DE") or None if not detectable
///
/// Details:
/// - Checks `LC_ALL`, `LC_MESSAG... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/global.rs | src/events/global.rs | //! Global shortcuts and dropdown menu handling.
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use tokio::sync::mpsc;
use crate::app::{apply_settings_to_app_state, initialize_locale_system};
use crate::events::mouse::menus::{handle_mode_toggle, handle_news_age_toggle};
use crate::events::utils;
use crate::... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/utils.rs | src/events/utils.rs | use crossterm::event::KeyEvent;
use tokio::sync::mpsc;
use crate::state::{AppState, PackageItem};
use std::time::Instant;
/// What: Check if a key event matches any chord in a list, handling Shift+char edge cases.
///
/// Inputs:
/// - `ke`: Key event from terminal
/// - `list`: List of configured key chords to match... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/mod.rs | src/events/mod.rs | //! Event handling layer for Pacsea's TUI (modularized).
//!
//! This module re-exports `handle_event` and delegates pane-specific logic
//! and mouse handling to submodules to keep files small and maintainable.
use crossterm::event::{Event as CEvent, KeyCode, KeyEventKind, KeyModifiers};
use tokio::sync::mpsc;
use c... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/recent.rs | src/events/recent.rs | use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use tokio::sync::mpsc;
use crate::logic::send_query;
use crate::state::{AppState, PackageItem, QueryInput};
use super::utils::{char_count, find_in_recent, matches_any, refresh_selected_details};
/// What: Handle key events while in pane-find mode for the Recen... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/distro.rs | src/events/distro.rs | //! Distro-specific helpers for events layer.
/// What: Build a shell snippet to refresh pacman mirrors depending on the detected distro.
///
/// Inputs:
/// - `countries`: Either "Worldwide" to auto-rank mirrors, or a comma-separated list used by the underlying tool
/// - `count`: Mirror count used by Manjaro fasttra... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/password.rs | src/events/modals/password.rs | //! Password prompt modal event handling.
use crossterm::event::{KeyCode, KeyEvent};
use crate::state::AppState;
/// What: Handle key events for password prompt modal.
///
/// Inputs:
/// - `ke`: Key event
/// - `app`: Mutable application state
/// - `input`: Mutable reference to password input buffer
/// - `cursor`... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/system_update.rs | src/events/modals/system_update.rs | //! System update modal handling.
use crossterm::event::{KeyCode, KeyEvent};
use crate::events::distro;
use crate::state::AppState;
/// What: Handle key events for `SystemUpdate` modal.
///
/// Inputs:
/// - `ke`: Key event
/// - `app`: Mutable application state
/// - `do_mirrors`: Mutable reference to mirrors flag
... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/handlers.rs | src/events/modals/handlers.rs | //! Individual modal handler functions that encapsulate field extraction and restoration.
use crossterm::event::{KeyCode, KeyEvent};
use tokio::sync::mpsc;
use super::restore;
use crate::install::ExecutorRequest;
use crate::state::{AppState, Modal, PackageItem};
/// What: Handle key events for Alert modal, including... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/optional_deps.rs | src/events/modals/optional_deps.rs | //! Optional dependencies modal handling.
use crossterm::event::{KeyCode, KeyEvent};
use crate::state::AppState;
/// What: Handle key events for `OptionalDeps` modal.
///
/// Inputs:
/// - `ke`: Key event
/// - `app`: Mutable application state
/// - `rows`: Optional dependency rows
/// - `selected`: Currently select... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/install.rs | src/events/modals/install.rs | //! Install and remove modal handling.
use crossterm::event::{KeyCode, KeyEvent};
use crate::state::{AppState, PackageItem};
/// What: Handle key events for `ConfirmInstall` modal.
///
/// Inputs:
/// - `ke`: Key event
/// - `app`: Mutable application state
/// - `items`: Package items to install
///
/// Output:
///... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/mod.rs | src/events/modals/mod.rs | //! Modal event handling module (excluding Preflight which is in preflight.rs).
mod common;
mod handlers;
mod import;
mod install;
mod optional_deps;
mod password;
mod restore;
mod scan;
mod system_update;
#[cfg(test)]
mod tests;
use crossterm::event::KeyEvent;
use tokio::sync::mpsc;
use crate::state::{AppState, Mo... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/common.rs | src/events/modals/common.rs | //! Common modal handlers (Alert, Help, News, `PreflightExec`, `PostSummary`, `GnomeTerminalPrompt`).
use crossterm::event::{KeyCode, KeyEvent};
use crate::state::{AppState, PackageItem, Source};
/// What: Show next pending announcement from queue if available.
///
/// Inputs:
/// - `app`: Application state to updat... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/import.rs | src/events/modals/import.rs | //! Import help modal handling.
use crossterm::event::{KeyCode, KeyEvent};
use tokio::sync::mpsc;
use crate::state::{AppState, PackageItem};
/// What: Handle key events for `ImportHelp` modal.
///
/// Inputs:
/// - `ke`: Key event
/// - `app`: Mutable application state
/// - `add_tx`: Channel for adding packages
///... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/restore.rs | src/events/modals/restore.rs | //! Helper functions for restoring modal state after event handling.
use crate::state::{AppState, Modal};
use crossterm::event::{KeyCode, KeyEvent};
/// What: Restore a modal if it wasn't closed by the handler and the key event
/// doesn't match any excluded keys.
///
/// Inputs:
/// - `app`: Mutable application stat... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/scan.rs | src/events/modals/scan.rs | //! Scan configuration and `VirusTotal` setup modal handling.
use crossterm::event::{KeyCode, KeyEvent};
#[cfg(not(target_os = "windows"))]
use crate::install::ExecutorRequest;
use crate::state::AppState;
#[cfg(not(target_os = "windows"))]
use crate::state::{PackageItem, Source};
/// What: Handle key events for `Sca... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/scan/tests.rs | src/events/modals/scan/tests.rs | //! Unit tests for scan configuration modal handlers.
use crate::state::AppState;
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use crate::events::modals::scan::handle_scan_config;
#[test]
/// What: Verify `ScanConfig` modal handles Esc to close.
///
/// Inputs:
/// - `ScanConfig` modal, Esc key event.
//... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/system_update.rs | src/events/modals/tests/system_update.rs | //! Tests for `SystemUpdate` modal key event handling.
use crossterm::event::{KeyCode, KeyModifiers};
use tokio::sync::mpsc;
use crate::state::PackageItem;
use super::common::{key_event, new_app};
use super::handle_modal_key;
#[test]
/// What: Verify Esc key closes `SystemUpdate` modal and doesn't restore it.
///
/... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/global_keybinds.rs | src/events/modals/tests/global_keybinds.rs | //! Tests for global keybind blocking when modals are open.
use crossterm::event::{KeyCode, KeyModifiers};
use tokio::sync::mpsc;
use crate::state::PackageItem;
use super::common::{create_test_modals, key_event, new_app};
use super::handle_modal_key;
#[test]
/// What: Verify Ctrl+R (reload config) is blocked when m... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/preflight.rs | src/events/modals/tests/preflight.rs | //! Tests for `PreflightExec` modal key event handling.
use crossterm::event::{KeyCode, KeyModifiers};
use tokio::sync::mpsc;
use crate::state::{PackageItem, PreflightAction, PreflightTab, modal::PreflightHeaderChips};
use super::common::{key_event, new_app};
use super::handle_modal_key;
#[test]
/// What: Verify Es... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/help.rs | src/events/modals/tests/help.rs | //! Tests for Help modal key event handling.
use crossterm::event::{KeyCode, KeyModifiers};
use tokio::sync::mpsc;
use crate::state::PackageItem;
use super::common::{key_event, new_app};
use super::handle_modal_key;
#[test]
/// What: Verify Esc key closes Help modal.
///
/// Inputs:
/// - Help modal
/// - Esc key e... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/optional_deps.rs | src/events/modals/tests/optional_deps.rs | //! Tests for `OptionalDeps` modal key event handling.
use crossterm::event::{KeyCode, KeyModifiers};
use tokio::sync::mpsc;
use crate::state::PackageItem;
use super::common::{key_event, new_app};
use super::handle_modal_key;
#[test]
/// What: Verify Esc key closes `OptionalDeps` modal and doesn't restore it.
///
/... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/mod.rs | src/events/modals/tests/mod.rs | //! Tests for modal key event handling, particularly Esc key bug fixes.
mod alert;
mod common;
mod confirm;
mod global_keybinds;
mod help;
mod news;
mod optional_deps;
mod other;
mod post_summary;
mod preflight;
mod scan;
mod system_update;
// Re-export handle_modal_key_test for tests
pub(super) use crate::events::mo... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/other.rs | src/events/modals/tests/other.rs | //! Tests for other modal key event handling (`GnomeTerminalPrompt`, `ImportHelp`).
use crossterm::event::{KeyCode, KeyModifiers};
use tokio::sync::mpsc;
use crate::state::PackageItem;
use super::common::{key_event, new_app};
use super::handle_modal_key;
#[test]
/// What: Verify Esc key closes `GnomeTerminalPrompt`... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/post_summary.rs | src/events/modals/tests/post_summary.rs | //! Tests for `PostSummary` modal key event handling.
use crossterm::event::{KeyCode, KeyModifiers};
use tokio::sync::mpsc;
use crate::state::PackageItem;
use super::common::{key_event, new_app};
use super::handle_modal_key;
#[test]
/// What: Verify Esc key closes `PostSummary` modal and doesn't restore it.
///
///... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/alert.rs | src/events/modals/tests/alert.rs | //! Tests for Alert modal key event handling.
use crossterm::event::{KeyCode, KeyModifiers};
use tokio::sync::mpsc;
use crate::state::PackageItem;
use super::common::{key_event, new_app};
use super::handle_modal_key;
#[test]
/// What: Verify Esc key closes Alert modal.
///
/// Inputs:
/// - Alert modal with message... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/common.rs | src/events/modals/tests/common.rs | //! Common test utilities for modal key event handling tests.
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use crate::state::{AppState, PreflightAction, PreflightTab, modal::PreflightHeaderChips};
/// What: Create a baseline `AppState` for modal tests.
///
/// Inputs:
/// - None
///
/// Output:
/// - Fre... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/news.rs | src/events/modals/tests/news.rs | //! Tests for News modal key event handling.
use crossterm::event::{KeyCode, KeyModifiers};
use tokio::sync::mpsc;
use crate::state::PackageItem;
use super::common::{key_event, new_app};
use super::handle_modal_key;
#[test]
/// What: Verify Esc key closes News modal and doesn't restore it.
///
/// Inputs:
/// - New... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/confirm.rs | src/events/modals/tests/confirm.rs | //! Tests for `ConfirmInstall` and `ConfirmRemove` modal key event handling.
use crossterm::event::{KeyCode, KeyModifiers};
use tokio::sync::mpsc;
use crate::state::{PackageItem, Source};
use super::common::{key_event, new_app};
use super::handle_modal_key;
#[test]
/// What: Verify Esc key closes `ConfirmInstall` m... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/tests/scan.rs | src/events/modals/tests/scan.rs | //! Tests for `ScanConfig` and `VirusTotalSetup` modal key event handling.
use crossterm::event::{KeyCode, KeyModifiers};
use tokio::sync::mpsc;
use crate::state::PackageItem;
use super::common::{key_event, new_app};
use super::handle_modal_key;
#[test]
/// What: Verify Esc key closes `ScanConfig` modal and doesn't... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/optional_deps/tests.rs | src/events/modals/optional_deps/tests.rs | //! Unit tests for optional dependencies modal handlers.
use crate::state::{AppState, types::OptionalDepRow};
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use crate::events::modals::optional_deps::handle_optional_deps;
/// What: Create a test optional dependency row.
///
/// Inputs:
/// - `package`: Pack... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/system_update/tests.rs | src/events/modals/system_update/tests.rs | //! Unit tests for system update modal handlers.
use crate::state::AppState;
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use super::handle_system_update;
#[test]
/// What: Verify `SystemUpdate` modal handles Esc to close.
///
/// Inputs:
/// - `SystemUpdate` modal, Esc key event.
///
/// Output:
/// - M... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/modals/install/tests.rs | src/events/modals/install/tests.rs | //! Unit tests for install and remove modal handlers.
#![cfg(test)]
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use crate::state::{AppState, PackageItem, Source};
use super::{handle_confirm_install, handle_confirm_remove};
/// What: Create a test package item with specified source.
///
/// Inputs:
/// ... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/preflight/tests.rs | src/events/preflight/tests.rs | //! Tests for Preflight modal event handling.
#[cfg(test)]
use super::display::{
build_file_display_items, compute_display_items_len, compute_file_display_items_len,
};
#[cfg(test)]
use super::keys::handle_preflight_key;
#[cfg(test)]
use crate::state::modal::{
CascadeMode, DependencyInfo, DependencySource, Dep... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/preflight/display.rs | src/events/preflight/display.rs | //! Display computation functions for Preflight modal tabs.
use std::collections::{HashMap, HashSet};
use crate::state::PackageItem;
/// What: Compute how many rows the dependency list will render in the Preflight Deps tab.
///
/// Inputs:
/// - `items`: Packages selected for install/remove shown in the modal
/// - ... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/preflight/mod.rs | src/events/preflight/mod.rs | //! Preflight modal event handling.
pub mod display;
pub mod keys;
mod modal;
#[cfg(test)]
mod tests;
pub use display::{build_file_display_items, compute_file_display_items_len};
pub use keys::handle_preflight_key;
| rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/preflight/modal.rs | src/events/preflight/modal.rs | //! Modal management functions for Preflight modal.
use crate::state::{AppState, PackageItem};
/// Parameters for handling deps tab switch.
struct DepsTabParams<'a> {
/// Dependency information list.
dependency_info: &'a mut Vec<crate::state::modal::DependencyInfo>,
/// Currently selected dependency index... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/preflight/keys/command_keys.rs | src/events/preflight/keys/command_keys.rs | //! Command key handlers for Preflight modal.
use std::sync::{Arc, Mutex};
use crate::state::{AppState, PackageItem};
use crate::events::preflight::modal::close_preflight_modal;
/// What: Handle F key - sync file database.
///
/// Inputs:
/// - `app`: Mutable application state
///
/// Output:
/// - Always returns `... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/preflight/keys/action_keys.rs | src/events/preflight/keys/action_keys.rs | //! Action key handlers for Preflight modal.
use std::collections::HashMap;
use crate::state::AppState;
use crate::state::modal::ServiceRestartDecision;
use super::context::{EnterOrSpaceContext, PreflightKeyContext};
use super::tab_handlers::handle_enter_or_space;
use crate::events::preflight::modal::close_preflight... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/preflight/keys/tab_handlers.rs | src/events/preflight/keys/tab_handlers.rs | //! Tab-specific handlers for Enter/Space key actions.
use std::collections::{HashMap, HashSet};
use crate::state::modal::ServiceRestartDecision;
use super::context::EnterOrSpaceContext;
use crate::events::preflight::display::build_file_display_items;
/// What: Handle Enter or Space key for Deps tab tree expansion/... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/preflight/keys/navigation.rs | src/events/preflight/keys/navigation.rs | //! Navigation key handlers for Preflight modal.
use crate::state::AppState;
use super::context::PreflightKeyContext;
use crate::events::preflight::display::{
compute_display_items_len, compute_file_display_items_len, compute_sandbox_display_items_len,
};
use crate::events::preflight::modal::switch_preflight_tab;... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/preflight/keys/mod.rs | src/events/preflight/keys/mod.rs | //! Key event handling for Preflight modal.
mod action_keys;
mod command_keys;
mod context;
mod navigation;
mod tab_handlers;
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use crate::state::AppState;
use action_keys::{
handle_a_key, handle_d_key, handle_enter_key, handle_esc_key, handle_r_key, handle... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/preflight/keys/context.rs | src/events/preflight/keys/context.rs | //! Context structs for Preflight key handling.
use std::collections::{HashMap, HashSet};
use crate::state::PackageItem;
/// What: Context struct grouping parameters for Enter/Space key handling.
///
/// Details:
/// - Reduces function argument count to avoid clippy warnings.
pub struct EnterOrSpaceContext<'a> {
... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/events/search/preflight_helpers.rs | src/events/search/preflight_helpers.rs | use crate::state::{AppState, PackageItem};
/// What: Filter cached dependencies for current items.
///
/// Inputs:
/// - `app`: Application state with cached dependencies.
/// - `item_names`: Set of current package names.
///
/// Output:
/// - Vector of matching cached dependencies.
fn filter_cached_dependencies(
... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.