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
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/util.rs
src/util.rs
use std::{io::stdin, sync::mpsc, thread, time::Duration}; use termion::{event::Key, input::TermRead}; pub enum Event<I> { Input(I), Tick, } /// A small event handler that wrap termion input and tick events. Each event /// type is handled in its own thread and returned to a common `Receiver` pub struct Events ...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/redirect_uri.rs
src/redirect_uri.rs
use rspotify::{oauth2::SpotifyOAuth, util::request_token}; use std::{ io::prelude::*, net::{TcpListener, TcpStream}, }; pub fn redirect_uri_web_server(spotify_oauth: &mut SpotifyOAuth, port: u16) -> Result<String, ()> { let listener = TcpListener::bind(format!("127.0.0.1:{}", port)); match listener { Ok(l...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/main.rs
src/main.rs
mod app; mod banner; mod cli; mod config; mod event; mod handlers; mod network; mod redirect_uri; mod ui; mod user_config; use crate::app::RouteId; use crate::event::Key; use anyhow::{anyhow, Result}; use app::{ActiveBlock, App}; use backtrace::Backtrace; use banner::BANNER; use clap::{App as ClapApp, Arg, Shell}; use...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/event/key.rs
src/event/key.rs
use crossterm::event; use std::fmt; /// Represents an key. #[derive(PartialEq, Eq, Clone, Copy, Hash, Debug)] pub enum Key { /// Both Enter (or Return) and numpad Enter Enter, /// Tabulation key Tab, /// Backspace key Backspace, /// Escape key Esc, /// Left arrow Left, /// Right arrow Right, ...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/event/mod.rs
src/event/mod.rs
mod events; mod key; pub use self::{ events::{Event, Events}, key::Key, };
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/event/events.rs
src/event/events.rs
use crate::event::Key; use crossterm::event; use std::{sync::mpsc, thread, time::Duration}; #[derive(Debug, Clone, Copy)] /// Configuration for event handling. pub struct EventConfig { /// The key that is used to exit the application. pub exit_key: Key, /// The tick rate at which the application will sent an tic...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/select_device.rs
src/handlers/select_device.rs
use super::{ super::app::{ActiveBlock, App}, common_key_events, }; use crate::event::Key; use crate::network::IoEvent; pub fn handler(key: Key, app: &mut App) { match key { Key::Esc => { app.set_current_route_state(Some(ActiveBlock::Library), None); } k if common_key_events::down_event(k) => { ...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/recently_played.rs
src/handlers/recently_played.rs
use super::{super::app::App, common_key_events}; use crate::{app::RecommendationsContext, event::Key, network::IoEvent}; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::left_event(k) => common_key_events::handle_left_event(app), k if common_key_events::down_event(k) => { i...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/track_table.rs
src/handlers/track_table.rs
use super::{ super::app::{App, RecommendationsContext, TrackTable, TrackTableContext}, common_key_events, }; use crate::event::Key; use crate::network::IoEvent; use rand::{thread_rng, Rng}; use serde_json::from_value; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::left_event(k)...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/playbar.rs
src/handlers/playbar.rs
use super::{ super::app::{ActiveBlock, App}, common_key_events, }; use crate::event::Key; use crate::network::IoEvent; use rspotify::model::{context::CurrentlyPlaybackContext, PlayingItem}; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::up_event(k) => { app.set_current_ro...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/common_key_events.rs
src/handlers/common_key_events.rs
use super::super::app::{ActiveBlock, App, RouteId}; use crate::event::Key; pub fn down_event(key: Key) -> bool { matches!(key, Key::Down | Key::Char('j') | Key::Ctrl('n')) } pub fn up_event(key: Key) -> bool { matches!(key, Key::Up | Key::Char('k') | Key::Ctrl('p')) } pub fn left_event(key: Key) -> bool { matc...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/dialog.rs
src/handlers/dialog.rs
use super::super::app::{ActiveBlock, App, DialogContext}; use crate::event::Key; pub fn handler(key: Key, app: &mut App) { match key { Key::Enter => { if let Some(route) = app.pop_navigation_stack() { if app.confirm { if let ActiveBlock::Dialog(d) = route.active_block { match ...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/empty.rs
src/handlers/empty.rs
use super::common_key_events; use crate::{ app::{ActiveBlock, App}, event::Key, }; // When no block is actively selected, just handle regular event pub fn handler(key: Key, app: &mut App) { match key { Key::Enter => { let current_hovered = app.get_current_route().hovered_block; app.set_current_ro...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/analysis.rs
src/handlers/analysis.rs
use crate::{app::App, event::Key}; pub fn handler(_key: Key, _app: &mut App) {}
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/search_results.rs
src/handlers/search_results.rs
use super::{ super::app::{ ActiveBlock, App, DialogContext, RecommendationsContext, RouteId, SearchResultBlock, TrackTableContext, }, common_key_events, }; use crate::event::Key; use crate::network::IoEvent; fn handle_down_press_on_selected_block(app: &mut App) { // Start selecting within the selected ...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/episode_table.rs
src/handlers/episode_table.rs
use super::{ super::app::{App, EpisodeTableContext}, common_key_events, }; use crate::app::ActiveBlock; use crate::event::Key; use crate::network::IoEvent; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::left_event(k) => common_key_events::handle_left_event(app), k if common...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/made_for_you.rs
src/handlers/made_for_you.rs
use super::{ super::app::{App, TrackTableContext}, common_key_events, }; use crate::event::Key; use crate::network::IoEvent; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::left_event(k) => common_key_events::handle_left_event(app), k if common_key_events::up_event(k) => { ...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/home.rs
src/handlers/home.rs
use super::{super::app::App, common_key_events}; use crate::event::Key; const LARGE_SCROLL: u16 = 10; const SMALL_SCROLL: u16 = 1; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::left_event(k) => common_key_events::handle_left_event(app), k if common_key_events::down_event(k) =...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/album_tracks.rs
src/handlers/album_tracks.rs
use super::common_key_events; use crate::{ app::{AlbumTableContext, App, RecommendationsContext}, event::Key, network::IoEvent, }; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::left_event(k) => common_key_events::handle_left_event(app), k if common_key_events::down_event...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/library.rs
src/handlers/library.rs
use super::{ super::app::{ActiveBlock, App, RouteId, LIBRARY_OPTIONS}, common_key_events, }; use crate::event::Key; use crate::network::IoEvent; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::right_event(k) => common_key_events::handle_right_event(app), k if common_key_even...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/artist.rs
src/handlers/artist.rs
use super::common_key_events; use crate::app::{ActiveBlock, App, ArtistBlock, RecommendationsContext, TrackTableContext}; use crate::event::Key; use crate::network::IoEvent; fn handle_down_press_on_selected_block(app: &mut App) { if let Some(artist) = &mut app.artist { match artist.artist_selected_block { ...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/playlist.rs
src/handlers/playlist.rs
use super::{ super::app::{App, DialogContext, TrackTableContext}, common_key_events, }; use crate::app::{ActiveBlock, RouteId}; use crate::event::Key; use crate::network::IoEvent; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::right_event(k) => common_key_events::handle_right_e...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/artist_albums.rs
src/handlers/artist_albums.rs
use super::common_key_events; use crate::{ app::{App, TrackTableContext}, event::Key, }; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::left_event(k) => common_key_events::handle_left_event(app), k if common_key_events::down_event(k) => { if let So...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/mod.rs
src/handlers/mod.rs
mod album_list; mod album_tracks; mod analysis; mod artist; mod artists; mod basic_view; mod common_key_events; mod dialog; mod empty; mod episode_table; mod error_screen; mod help_menu; mod home; mod input; mod library; mod made_for_you; mod playbar; mod playlist; mod podcasts; mod recently_played; mod search_results;...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/album_list.rs
src/handlers/album_list.rs
use super::common_key_events; use crate::{ app::{ActiveBlock, AlbumTableContext, App, RouteId, SelectedFullAlbum}, event::Key, }; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::left_event(k) => common_key_events::handle_left_event(app), k if common_key_events::down_event(k)...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/basic_view.rs
src/handlers/basic_view.rs
use crate::{app::App, event::Key, network::IoEvent}; use rspotify::model::{context::CurrentlyPlaybackContext, PlayingItem}; pub fn handler(key: Key, app: &mut App) { if let Key::Char('s') = key { if let Some(CurrentlyPlaybackContext { item: Some(item), .. }) = app.current_playback_context.to_owned() ...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/artists.rs
src/handlers/artists.rs
use super::common_key_events; use crate::{ app::{ActiveBlock, App, RecommendationsContext, RouteId}, event::Key, network::IoEvent, }; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::left_event(k) => common_key_events::handle_left_event(app), k if common_key_events::down_ev...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/help_menu.rs
src/handlers/help_menu.rs
use super::common_key_events; use crate::{app::App, event::Key}; #[derive(PartialEq)] enum Direction { Up, Down, } pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::down_event(k) => { move_page(Direction::Down, app); } k if common_key_events::up_event(k) => { ...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/input.rs
src/handlers/input.rs
extern crate unicode_width; use super::super::app::{ActiveBlock, App, RouteId}; use crate::event::Key; use crate::network::IoEvent; use std::convert::TryInto; use unicode_width::{UnicodeWidthChar, UnicodeWidthStr}; // Handle event when the search input block is active pub fn handler(key: Key, app: &mut App) { match...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/podcasts.rs
src/handlers/podcasts.rs
use super::common_key_events; use crate::{ app::{ActiveBlock, App}, event::Key, network::IoEvent, }; pub fn handler(key: Key, app: &mut App) { match key { k if common_key_events::left_event(k) => common_key_events::handle_left_event(app), k if common_key_events::down_event(k) => { if let Some(sho...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/handlers/error_screen.rs
src/handlers/error_screen.rs
use crate::{app::App, event::Key}; pub fn handler(_key: Key, _app: &mut App) {}
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/cli/clap.rs
src/cli/clap.rs
use clap::{App, Arg, ArgGroup, SubCommand}; fn device_arg() -> Arg<'static, 'static> { Arg::with_name("device") .short("d") .long("device") .takes_value(true) .value_name("DEVICE") .help("Specifies the spotify device to use") } fn format_arg() -> Arg<'static, 'static> { Arg::with_name("format"...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/cli/util.rs
src/cli/util.rs
use clap::ArgMatches; use rspotify::{ model::{ album::SimplifiedAlbum, artist::FullArtist, artist::SimplifiedArtist, playlist::SimplifiedPlaylist, show::FullEpisode, show::SimplifiedShow, track::FullTrack, }, senum::RepeatState, }; use crate::user_config::UserConfig; // Possible types to list or search ...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/cli/mod.rs
src/cli/mod.rs
mod clap; mod cli_app; mod handle; mod util; pub use self::clap::{list_subcommand, play_subcommand, playback_subcommand, search_subcommand}; use cli_app::CliApp; pub use handle::handle_matches;
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/cli/cli_app.rs
src/cli/cli_app.rs
use crate::network::{IoEvent, Network}; use crate::user_config::UserConfig; use super::util::{Flag, Format, FormatType, JumpDirection, Type}; use anyhow::{anyhow, Result}; use rand::{thread_rng, Rng}; use rspotify::model::{context::CurrentlyPlaybackContext, PlayingItem}; pub struct CliApp<'a> { pub net: Network<'a...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/cli/handle.rs
src/cli/handle.rs
use crate::network::{IoEvent, Network}; use crate::user_config::UserConfig; use super::{ util::{Flag, JumpDirection, Type}, CliApp, }; use anyhow::{anyhow, Result}; use clap::ArgMatches; // Handle the different subcommands pub async fn handle_matches( matches: &ArgMatches<'_>, cmd: String, net: Network<'_>...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/ui/audio_analysis.rs
src/ui/audio_analysis.rs
use super::util; use crate::app::App; use tui::{ backend::Backend, layout::{Constraint, Direction, Layout}, style::Style, text::{Span, Spans}, widgets::{BarChart, Block, Borders, Paragraph}, Frame, }; const PITCHES: [&str; 12] = [ "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B", ]; pub fn...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/ui/help.rs
src/ui/help.rs
use crate::user_config::KeyBindings; pub fn get_help_docs(key_bindings: &KeyBindings) -> Vec<Vec<String>> { vec![ vec![ String::from("Scroll down to next result page"), key_bindings.next_page.to_string(), String::from("Pagination"), ], vec![ String::from("Scroll up to previous res...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/ui/util.rs
src/ui/util.rs
use super::super::app::{ActiveBlock, App, ArtistBlock, SearchResultBlock}; use crate::user_config::Theme; use rspotify::model::artist::SimplifiedArtist; use tui::style::Style; pub const BASIC_VIEW_HEIGHT: u16 = 6; pub const SMALL_TERMINAL_WIDTH: u16 = 150; pub const SMALL_TERMINAL_HEIGHT: u16 = 45; pub fn get_search_...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
false
Rigellute/spotify-tui
https://github.com/Rigellute/spotify-tui/blob/c4dcf6b9fd8318017acbdd7ec005955e26cf2794/src/ui/mod.rs
src/ui/mod.rs
pub mod audio_analysis; pub mod help; pub mod util; use super::{ app::{ ActiveBlock, AlbumTableContext, App, ArtistBlock, EpisodeTableContext, RecommendationsContext, RouteId, SearchResultBlock, LIBRARY_OPTIONS, }, banner::BANNER, }; use help::get_help_docs; use rspotify::model::show::ResumePoint; use rsp...
rust
MIT
c4dcf6b9fd8318017acbdd7ec005955e26cf2794
2026-01-04T15:43:14.194500Z
true
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/build.rs
build.rs
use chrono::TimeZone; fn get_git_hash() -> String { use std::process::Command; // Allow builds from `git archive` generated tarballs if output of `git get-tar-commit-id` is // set in an env var. if let Ok(commit) = std::env::var("BUILD_GIT_COMMIT_ID") { return commit[..7].to_string(); }; let commit = Command:...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/scopetime/src/lib.rs
scopetime/src/lib.rs
//! simple macro to insert a scope based runtime measure that logs the result #![forbid(unsafe_code)] #![deny(mismatched_lifetime_syntaxes, unused_imports)] #![deny(clippy::unwrap_used)] #![deny(clippy::perf)] use std::time::Instant; pub struct ScopeTimeLog<'a> { title: &'a str, mod_path: &'a str, file: &'a str, ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/git2-testing/src/lib.rs
git2-testing/src/lib.rs
#![deny(mismatched_lifetime_syntaxes)] use git2::Repository; use tempfile::TempDir; /// initialize test repo in temp path pub fn repo_init_empty() -> (TempDir, Repository) { init_log(); sandbox_config_files(); let td = TempDir::new().unwrap(); let repo = Repository::init(td.path()).unwrap(); { let mut config...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/git2-hooks/src/lib.rs
git2-hooks/src/lib.rs
//! git2-rs addon supporting git hooks //! //! we look for hooks in the following locations: //! * whatever `config.hooksPath` points to //! * `.git/hooks/` //! * whatever list of paths provided as `other_paths` (in order) //! //! most basic hook is: [`hooks_pre_commit`]. see also other `hooks_*` functions. //! //! ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/git2-hooks/src/error.rs
git2-hooks/src/error.rs
use thiserror::Error; /// crate specific error type #[derive(Error, Debug)] pub enum HooksError { #[error("git error:{0}")] Git(#[from] git2::Error), #[error("io error:{0}")] Io(#[from] std::io::Error), #[error("path string conversion error")] PathToString, #[error("shellexpand error:{0}")] ShellExpand(#[fr...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/git2-hooks/src/hookspath.rs
git2-hooks/src/hookspath.rs
use git2::Repository; use crate::{error::Result, HookResult, HooksError}; use std::{ ffi::{OsStr, OsString}, path::{Path, PathBuf}, process::Command, str::FromStr, }; pub struct HookPaths { pub git: PathBuf, pub hook: PathBuf, pub pwd: PathBuf, } const CONFIG_HOOKS_PATH: &str = "core.hooksPath"; const DEFAUL...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/app.rs
src/app.rs
use crate::{ accessors, args::CliArgs, cmdbar::CommandBar, components::{ command_pump, event_pump, CommandInfo, Component, DrawableComponent, FuzzyFinderTarget, }, input::{Input, InputEvent, InputState}, keys::{key_match, KeyConfig, SharedKeyConfig}, options::{Options, SharedOptions}, popup_stack::PopupSta...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/bug_report.rs
src/bug_report.rs
use bugreport::{ bugreport, collector::{ CommandLine, CompileTimeInformation, EnvironmentVariables, OperatingSystem, SoftwareVersion, }, format::Markdown, }; pub fn generate_bugreport() { bugreport!() .info(SoftwareVersion::default()) .info(OperatingSystem::default()) .info(CompileTimeInformation::defau...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/clipboard.rs
src/clipboard.rs
use anyhow::{anyhow, Result}; use std::io::Write; use std::path::PathBuf; use std::process::{Command, Stdio}; use which::which; fn exec_copy_with_args( command: &str, args: &[&str], text: &str, pipe_stderr: bool, ) -> Result<()> { let binary = which(command) .ok() .unwrap_or_else(|| PathBuf::from(command)); ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/args.rs
src/args.rs
use crate::bug_report; use anyhow::{anyhow, Context, Result}; use asyncgit::sync::RepoPath; use clap::{ builder::ArgPredicate, crate_authors, crate_description, crate_name, Arg, Command as ClapApp, }; use simplelog::{Config, LevelFilter, WriteLogger}; use std::{ env, fs::{self, File}, path::PathBuf, }; const BUG_...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/watcher.rs
src/watcher.rs
use anyhow::Result; use crossbeam_channel::{unbounded, Sender}; use notify::{RecommendedWatcher, RecursiveMode, Watcher}; use notify_debouncer_mini::{new_debouncer, DebounceEventResult}; use scopetime::scope_time; use std::{path::Path, thread, time::Duration}; pub struct RepoWatcher { receiver: crossbeam_channel::Rec...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popup_stack.rs
src/popup_stack.rs
use crate::queue::StackablePopupOpen; #[derive(Default)] pub struct PopupStack { stack: Vec<StackablePopupOpen>, } impl PopupStack { pub fn push(&mut self, popup: StackablePopupOpen) { self.stack.push(popup); } pub fn pop(&mut self) -> Option<StackablePopupOpen> { self.stack.pop() } }
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/cmdbar.rs
src/cmdbar.rs
use crate::{ components::CommandInfo, keys::SharedKeyConfig, strings, ui::style::SharedTheme, }; use ratatui::{ layout::{Alignment, Rect}, text::{Line, Span}, widgets::Paragraph, Frame, }; use std::borrow::Cow; use unicode_width::UnicodeWidthStr; enum DrawListEntry { LineBreak, Splitter, Command(Command), } ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/options.rs
src/options.rs
use anyhow::Result; use asyncgit::sync::{ diff::DiffOptions, repo_dir, RepoPathRef, ShowUntrackedFilesConfig, }; use ron::{ de::from_bytes, ser::{to_string_pretty, PrettyConfig}, }; use serde::{Deserialize, Serialize}; use std::{ cell::RefCell, fs::File, io::{Read, Write}, path::PathBuf, rc::Rc, }; #[derive(D...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/strings.rs
src/strings.rs
use std::borrow::Cow; use asyncgit::sync::CommitId; use unicode_truncate::UnicodeTruncateStr; use unicode_width::UnicodeWidthStr; use crate::keys::SharedKeyConfig; pub mod order { pub const RARE_ACTION: i8 = 30; pub const NAV: i8 = 20; pub const AVERAGE: i8 = 10; pub const PRIORITY: i8 = 1; } pub static PUSH_PO...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
true
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/main.rs
src/main.rs
//! //! The gitui program is a text-based UI for working with a Git repository. //! The main navigation occurs between a number of tabs. //! When you execute commands, the program may use popups to communicate //! with the user. It is possible to customize the keybindings. //! //! //! ## Internal Modules //! The top-le...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/notify_mutex.rs
src/notify_mutex.rs
use std::sync::{Arc, Condvar, Mutex}; /// combines a `Mutex` and `Condvar` to allow waiting for a change in the variable protected by the `Mutex` #[derive(Clone, Debug)] pub struct NotifiableMutex<T> where T: Send + Sync, { data: Arc<(Mutex<T>, Condvar)>, } impl<T> NotifiableMutex<T> where T: Send + Sync, { /// ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/spinner.rs
src/spinner.rs
use ratatui::{ backend::{Backend, CrosstermBackend}, Terminal, }; use std::{cell::Cell, char, io}; // static SPINNER_CHARS: &[char] = &['◢', '◣', '◤', '◥']; // static SPINNER_CHARS: &[char] = &['⢹', '⢺', '⢼', '⣸', '⣇', '⡧', '⡗', '⡏']; static SPINNER_CHARS: &[char] = &['⣷', '⣯', '⣟', '⡿', '⢿', '⣻', '⣽', '⣾']; /// p...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/queue.rs
src/queue.rs
use crate::{ components::FuzzyFinderTarget, popups::{ AppOption, BlameFileOpen, FileRevOpen, FileTreeOpen, InspectCommitOpen, }, tabs::StashingOptions, }; use asyncgit::{ sync::{ diff::DiffLinePosition, BranchInfo, CommitId, LogFilterSearchOptions, }, PushType, }; use bitflags::bitflags; use std::{ cell...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/string_utils.rs
src/string_utils.rs
use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; /// pub fn trim_length_left(s: &str, width: usize) -> &str { let len = s.len(); if len > width { for i in len - width..len { if s.is_char_boundary(i) { return &s[i..]; } } } s } //TODO: allow customize tabsize pub fn...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/input.rs
src/input.rs
use crate::notify_mutex::NotifiableMutex; use anyhow::Result; use crossbeam_channel::{unbounded, Receiver, Sender}; use crossterm::event::{self, Event, Event::Key, KeyEventKind}; use std::{ sync::{ atomic::{AtomicBool, Ordering}, Arc, }, thread, time::Duration, }; static FAST_POLL_DURATION: Duration = Duration...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/commitlist.rs
src/components/commitlist.rs
use super::utils::logitems::{ItemBatch, LogEntry}; use crate::{ app::Environment, components::{ utils::string_width_align, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, ScrollType, }, keys::{key_match, SharedKeyConfig}, queue::{InternalEvent, Queue}, strings::{self, symbol}, try_or_...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/syntax_text.rs
src/components/syntax_text.rs
use super::{ CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, }; use crate::{ app::Environment, keys::SharedKeyConfig, string_utils::tabs_to_spaces, strings, ui::{ self, common_nav, style::SharedTheme, AsyncSyntaxJob, ParagraphState, ScrollPos, StatefulParagraph, }, AsyncAppNotificat...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/command.rs
src/components/command.rs
use crate::strings::order; /// #[derive(Clone, PartialEq, PartialOrd, Ord, Eq)] pub struct CommandText { /// pub name: String, /// pub desc: &'static str, /// pub group: &'static str, /// pub hide_help: bool, } impl CommandText { /// pub const fn new( name: String, desc: &'static str, group: &'static ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/textinput.rs
src/components/textinput.rs
use crate::app::Environment; use crate::keys::key_match; use crate::ui::Size; use crate::{ components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, }, keys::SharedKeyConfig, strings, ui::{self, style::SharedTheme}, }; use anyhow::Result; use crossterm::event::E...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/diff.rs
src/components/diff.rs
use super::{ utils::scroll_horizontal::HorizontalScroll, utils::scroll_vertical::VerticalScroll, CommandBlocking, Direction, DrawableComponent, HorizontalScrollType, ScrollType, }; use crate::{ app::Environment, components::{CommandInfo, Component, EventState}, keys::{key_match, SharedKeyConfig}, options::Shared...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/revision_files.rs
src/components/revision_files.rs
use super::{ utils::scroll_vertical::VerticalScroll, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, FuzzyFinderTarget, SyntaxTextComponent, }; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, popups::{BlameFileOpen, FileRevOpen}, queue::{InternalEvent, Queue, StackableP...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/status_tree.rs
src/components/status_tree.rs
use super::{ utils::{ filetree::{FileTreeItem, FileTreeItemKind}, statustree::{MoveSelection, StatusTree}, }, CommandBlocking, DrawableComponent, }; use crate::{ app::Environment, components::{CommandInfo, Component, EventState}, keys::{key_match, SharedKeyConfig}, popups::{BlameFileOpen, FileRevOpen}, queu...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/cred.rs
src/components/cred.rs
use anyhow::Result; use crossterm::event::Event; use ratatui::{layout::Rect, Frame}; use asyncgit::sync::cred::BasicAuthCredential; use crate::app::Environment; use crate::components::{EventState, InputType, TextInputComponent}; use crate::keys::key_match; use crate::{ components::{ visibility_blocking, CommandBlo...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/mod.rs
src/components/mod.rs
/*! Components are the visible building blocks in gitui. They have a state, handle events, and render to the terminal: * Some are full screen. That would be all the [`tabs`](super::tabs). * Some look like panels, eg [`CommitDetailsComponent`] * Some overlap others. They are collected in module [`popups`](super::popup...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/changes.rs
src/components/changes.rs
use super::{ status_tree::StatusTreeComponent, utils::filetree::{FileTreeItem, FileTreeItemKind}, CommandBlocking, DrawableComponent, }; use crate::{ app::Environment, components::{CommandInfo, Component, EventState}, keys::{key_match, SharedKeyConfig}, options::SharedOptions, queue::{Action, InternalEvent, Nee...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/commit_details/compare_details.rs
src/components/commit_details/compare_details.rs
use std::borrow::Cow; use crate::{ app::Environment, components::{ commit_details::style::{style_detail, Detail}, dialog_paragraph, utils::time_to_string, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, }, strings::{self}, ui::style::SharedTheme, }; use anyhow::Result; use asyncg...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/commit_details/mod.rs
src/components/commit_details/mod.rs
mod compare_details; mod details; mod style; use super::{ command_pump, event_pump, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, StatusTreeComponent, }; use crate::{ accessors, app::Environment, keys::{key_match, SharedKeyConfig}, strings, }; use anyhow::Result; use asyncgit::{ sync::...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/commit_details/style.rs
src/components/commit_details/style.rs
use crate::{strings, ui::style::SharedTheme}; use ratatui::text::Span; use std::borrow::Cow; pub enum Detail { Author, Date, Committer, Sha, Message, } pub fn style_detail<'a>( theme: &'a SharedTheme, field: &Detail, ) -> Span<'a> { match field { Detail::Author => Span::styled( Cow::from(strings::commit:...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/commit_details/details.rs
src/components/commit_details/details.rs
use crate::{ app::Environment, components::{ commit_details::style::style_detail, dialog_paragraph, utils::{scroll_vertical::VerticalScroll, time_to_string}, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, ScrollType, }, keys::{key_match, SharedKeyConfig}, strings::{self, order}, ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/utils/statustree.rs
src/components/utils/statustree.rs
use super::filetree::{ FileTreeItem, FileTreeItemKind, FileTreeItems, PathCollapsed, }; use anyhow::Result; use asyncgit::StatusItem; use std::{cell::Cell, cmp, collections::BTreeSet}; //TODO: use new `filetreelist` crate /// #[derive(Default)] pub struct StatusTree { pub tree: FileTreeItems, pub selection: Option...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/utils/filetree.rs
src/components/utils/filetree.rs
//TODO: remove in favour of new `filetreelist` crate use anyhow::{bail, Result}; use asyncgit::StatusItem; use std::{ collections::BTreeSet, ffi::OsStr, ops::{Index, IndexMut}, path::Path, }; /// holds the information shared among all `FileTreeItem` in a `FileTree` #[derive(Debug, Clone)] pub struct TreeItemInfo ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/utils/logitems.rs
src/components/utils/logitems.rs
use asyncgit::sync::{CommitId, CommitInfo}; use chrono::{DateTime, Duration, Local, Utc}; use indexmap::IndexSet; use std::{rc::Rc, slice::Iter}; #[cfg(feature = "ghemoji")] use super::emoji::emojifi_string; static SLICE_OFFSET_RELOAD_THRESHOLD: usize = 100; type BoxStr = Box<str>; pub struct LogEntry { //TODO: ca...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/utils/emoji.rs
src/components/utils/emoji.rs
use once_cell::sync::Lazy; use std::borrow::Cow; static EMOJI_REPLACER: Lazy<gh_emoji::Replacer> = Lazy::new(gh_emoji::Replacer::new); // Replace markdown emojis with Unicode equivalent // :hammer: --> 🔨 #[inline] pub fn emojifi_string(s: String) -> String { if let Cow::Owned(altered_s) = EMOJI_REPLACER.replace_al...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/utils/mod.rs
src/components/utils/mod.rs
use chrono::{DateTime, Local, Utc}; use unicode_width::UnicodeWidthStr; #[cfg(feature = "ghemoji")] pub mod emoji; pub mod filetree; pub mod logitems; pub mod scroll_horizontal; pub mod scroll_vertical; pub mod statustree; /// macro to simplify running code that might return Err. /// It will show a popup in that case...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/utils/scroll_vertical.rs
src/components/utils/scroll_vertical.rs
use crate::{ components::ScrollType, ui::{draw_scrollbar, style::SharedTheme, Orientation}, }; use ratatui::{layout::Rect, Frame}; use std::cell::Cell; pub struct VerticalScroll { top: Cell<usize>, max_top: Cell<usize>, visual_height: Cell<usize>, } impl VerticalScroll { pub const fn new() -> Self { Self { ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/components/utils/scroll_horizontal.rs
src/components/utils/scroll_horizontal.rs
use crate::{ components::HorizontalScrollType, ui::{draw_scrollbar, style::SharedTheme, Orientation}, }; use ratatui::{layout::Rect, Frame}; use std::cell::Cell; pub struct HorizontalScroll { right: Cell<usize>, max_right: Cell<usize>, } impl HorizontalScroll { pub const fn new() -> Self { Self { right: Cel...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/tabs/status.rs
src/tabs/status.rs
use crate::{ accessors, app::Environment, components::{ command_pump, event_pump, visibility_blocking, ChangesComponent, CommandBlocking, CommandInfo, Component, DiffComponent, DrawableComponent, EventState, FileTreeItemKind, }, keys::{key_match, SharedKeyConfig}, options::SharedOptions, queue::{Action, ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/tabs/stashlist.rs
src/tabs/stashlist.rs
use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, CommitList, Component, DrawableComponent, EventState, }, keys::{key_match, SharedKeyConfig}, popups::InspectCommitOpen, queue::{Action, InternalEvent, Queue, StackablePopupOpen}, strings, }; use anyhow::Result; us...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/tabs/mod.rs
src/tabs/mod.rs
/*! The tabs module contains a struct for each of the tabs visible in the ui: - [`Status`]: Stage changes, push, pull - [`Revlog`]: Revision log (think git log) - [`FilesTab`]: See content of any file at HEAD. Blame - [`Stashing`]: Managing one stash - [`StashList`]: Managing all stashes Many of the tabs can expand t...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/tabs/files.rs
src/tabs/files.rs
use std::path::{Path, PathBuf}; use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, RevisionFilesComponent, }, AsyncNotification, }; use anyhow::Result; use asyncgit::sync::{self, RepoPathRef}; pub struct FilesTab { repo: R...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/tabs/revlog.rs
src/tabs/revlog.rs
use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, CommitDetailsComponent, CommitList, Component, DrawableComponent, EventState, }, keys::{key_match, SharedKeyConfig}, popups::{FileTreeOpen, InspectCommitOpen}, queue::{InternalEvent, Queue, StackablePopupOpen}, ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/tabs/stashing.rs
src/tabs/stashing.rs
use crate::{ accessors, app::Environment, components::{ command_pump, event_pump, visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, StatusTreeComponent, }, keys::{key_match, SharedKeyConfig}, queue::{InternalEvent, Queue}, strings, ui::style::SharedTheme, }; use ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/branchlist.rs
src/popups/branchlist.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, FuzzyFinderTarget, VerticalScroll, }; use crate::{ app::Environment, components::ScrollType, keys::{key_match, SharedKeyConfig}, queue::{ Action, InternalEvent, NeedsUpdate, Queue, StackablePopu...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/rename_branch.rs
src/popups/rename_branch.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, InputType, TextInputComponent, }; use crate::ui::style::SharedTheme; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, queue::{InternalEvent, NeedsUpdate, Queue}, strings, }; use ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/taglist.rs
src/popups/taglist.rs
use crate::components::{ time_to_string, visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, }; use crate::{ app::Environment, components::ScrollType, keys::{key_match, SharedKeyConfig}, queue::{Action, InternalEvent, Queue}, strings, ui::{self, Size}, AsyncNotification...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/create_remote.rs
src/popups/create_remote.rs
use anyhow::Result; use asyncgit::sync::{self, validate_remote_name, RepoPathRef}; use crossterm::event::Event; use easy_cast::Cast; use ratatui::{widgets::Paragraph, Frame}; use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/fuzzy_find.rs
src/popups/fuzzy_find.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, FuzzyFinderTarget, InputType, ScrollType, TextInputComponent, }; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, queue::{InternalEvent, Queue}, string_utils::trim_length_left, ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/push.rs
src/popups/push.rs
use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, CredComponent, DrawableComponent, EventState, }, keys::{key_match, SharedKeyConfig}, queue::{InternalEvent, Queue}, strings, ui::{self, style::SharedTheme}, }; use anyhow::Result; use asyncgit::{ sync:...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/update_remote_url.rs
src/popups/update_remote_url.rs
use anyhow::Result; use asyncgit::sync::{self, RepoPathRef}; use crossterm::event::Event; use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, InputType, TextInputComponent, }, keys::{key_match, SharedKeyConfig}, queue::{Inte...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/rename_remote.rs
src/popups/rename_remote.rs
use anyhow::Result; use asyncgit::sync::{self, RepoPathRef}; use crossterm::event::Event; use easy_cast::Cast; use ratatui::{layout::Rect, widgets::Paragraph, Frame}; use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, InputTyp...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/externaleditor.rs
src/popups/externaleditor.rs
use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, }, keys::SharedKeyConfig, strings, ui::{self, style::SharedTheme}, }; use anyhow::{anyhow, bail, Result}; use asyncgit::sync::{ get_config_string, utils::repo_work_dir, Re...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/help.rs
src/popups/help.rs
use crate::components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, }; use crate::{ app::Environment, keys::{key_match, SharedKeyConfig}, strings, ui, }; use anyhow::Result; use asyncgit::hash; use crossterm::event::Event; use itertools::Itertools; use ratatui::{ ...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/blame_file.rs
src/popups/blame_file.rs
use crate::{ app::Environment, components::{ string_width_align, time_to_string, visibility_blocking, CommandBlocking, CommandInfo, Component, DrawableComponent, EventState, ScrollType, }, keys::{key_match, SharedKeyConfig}, popups::{FileRevOpen, InspectCommitOpen}, queue::{InternalEvent, Queue, StackablePo...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false
gitui-org/gitui
https://github.com/gitui-org/gitui/blob/d68f366b1b7106223a0b5ad2481a782a7bd68883/src/popups/push_tags.rs
src/popups/push_tags.rs
use crate::{ app::Environment, components::{ visibility_blocking, CommandBlocking, CommandInfo, Component, CredComponent, DrawableComponent, EventState, }, keys::{key_match, SharedKeyConfig}, queue::{InternalEvent, Queue}, strings, ui::{self, style::SharedTheme}, }; use anyhow::Result; use asyncgit::{ sync:...
rust
MIT
d68f366b1b7106223a0b5ad2481a782a7bd68883
2026-01-04T15:40:16.730844Z
false