mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-10-18 19:10:36 +08:00
inbox/list: Dissolve common module
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
#[path = "inbox/common.rs"]
|
||||
mod common;
|
||||
#[path = "inbox/list.rs"]
|
||||
mod list;
|
||||
|
||||
@@ -11,11 +9,10 @@ use radicle::storage::{HasRepoId, ReadRepository};
|
||||
|
||||
use radicle_cli::terminal::{Args, Error, Help};
|
||||
|
||||
use crate::commands::tui_inbox::common::InboxOperation;
|
||||
use crate::terminal;
|
||||
use crate::ui::items::notification::filter::{NotificationFilter, SortBy};
|
||||
|
||||
use self::common::RepositoryMode;
|
||||
use self::list::{InboxOperation, RepositoryMode};
|
||||
|
||||
pub const HELP: Help = Help {
|
||||
name: "inbox",
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
use serde::Serialize;
|
||||
|
||||
use radicle::{identity::RepoId, node::notifications::NotificationId};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Eq)]
|
||||
pub enum RepositoryMode {
|
||||
#[default]
|
||||
Contextual,
|
||||
All,
|
||||
ByRepo((RepoId, Option<String>)),
|
||||
}
|
||||
|
||||
/// The selected issue operation returned by the operation
|
||||
/// selection widget.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
|
||||
pub enum InboxOperation {
|
||||
Show { id: NotificationId },
|
||||
Clear { id: NotificationId },
|
||||
}
|
||||
@@ -6,6 +6,9 @@ use std::vec;
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
use serde::Serialize;
|
||||
|
||||
use radicle::node::notifications::NotificationId;
|
||||
use ratatui::layout::{Constraint, Layout};
|
||||
use ratatui::prelude::*;
|
||||
use ratatui::text::Span;
|
||||
@@ -29,12 +32,26 @@ use tui::ui::widget::{
|
||||
use tui::ui::{BufferedValue, Show, Ui};
|
||||
use tui::{Channel, Exit};
|
||||
|
||||
use super::common::RepositoryMode;
|
||||
use crate::commands::tui_inbox::common::InboxOperation;
|
||||
use crate::ui::items::filter::Filter;
|
||||
use crate::ui::items::notification::filter::{NotificationFilter, SortBy};
|
||||
use crate::ui::items::notification::{Notification, NotificationKind};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Eq)]
|
||||
pub enum RepositoryMode {
|
||||
#[default]
|
||||
Contextual,
|
||||
All,
|
||||
ByRepo((RepoId, Option<String>)),
|
||||
}
|
||||
|
||||
/// The selected issue operation returned by the operation
|
||||
/// selection widget.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
|
||||
pub enum InboxOperation {
|
||||
Show { id: NotificationId },
|
||||
Clear { id: NotificationId },
|
||||
}
|
||||
|
||||
type Selection = tui::Selection<InboxOperation>;
|
||||
|
||||
const HELP: &str = r#"# Generic keybindings
|
||||
|
||||
Reference in New Issue
Block a user