handle multiple or no pijul identity
Dependencies
- [2]
EC3TVL4Xadd untracked files - [3]
2VUX5BTDload identity - [4]
A5YBC77Vrecord! - [5]
4WO3ZJM2show untracked files' contents - [6]
23SFYK4Qbig view refactor into a new crate - [7]
7SSBM4UQview: refactor repo view - [8]
JZXYSIYDchannel selection! - [9]
WAOGSCOJvery nice refactor, wip adding channels logs - [10]
EJPSD5XOshared allowed actions conditions between update and view - [11]
YK3MOJJLchonky refactor, wip other channels logs & diffs - [12]
7WCB5YQJrefactor msgs and modules - [13]
AZ5D2LQUallow to set record description - [14]
PKLUHYE4allow to copy change hash - [15]
KF2LDB5Yhandle repo init errors - [16]
LFEMJYYDstart of to_record selection - [17]
UTDTZCTXpull+push status, add info reports - [18]
OLT666N4fix screenshot test to include status, fix failed test report - [19]
TEDT26JQadd push and pull sub-menus - [20]
YRGDFHABproject dir picker - [21]
LPSUBGUBadd projects picker - [22]
5BAPU7K6dir picker key navigation - [23]
T4UECD3Spicking projects key nav and scrollable - [24]
IOXNOVX2allow to initiate a new repo - [25]
6E6MSENZallow to add untracked files recursively - [26]
ACDXXAX2refactor main's updates into smaller fns - [27]
YKHE3XMWrefactor diffs handling - [28]
3SYSJKYLadd app icon - [29]
GOLHUD6Rnav-scrollable: set skip-able sections - [30]
ELG3UDT6allow to rm added files - [31]
ZVI4AWERwoot contents_diff - [32]
MORKDJUEuse allowed actions binding for key subs - [33]
UB2ITZJSrefresh changed files on FS changes - [34]
ONRCENKTrm unnecessary state from repo's internal state - [35]
CFYW3HGZwip: display changed files - [36]
V55EAIWQadd src file LRU cache - [37]
NRCUG4R2load changed files src when selected - [38]
PTFDJ567add untracked files encoding - [39]
AHWWRC73navigate log entries - [40]
L6KSEFQImove cursor related stuff into its module - [41]
HC7ROIBCmove main diffs state out of cursor - [42]
UR4J677Rnav for log changes and refactors - [43]
KM5PSZ4Awatch repo once loaded - [44]
FVA36HBVrestart repo manager task if it crashes - [45]
CULHFNIVadd error report view - [46]
AMPZ2BXKshow changed files diffs (only Edit atm) - [47]
I2AG42PAnew cols layout - [48]
SASAN2XCuse nav-scrollable - [49]
W7IUT3ZVstart recording impl - [50]
UJPRF6DAfix log changes selection - [51]
KWTBNTO3diffs selection and scrolling - [52]
FR52XEMWadd action for log change file diff - [53]
TEI5NQ3Sadd log files selection - [54]
OQ6HSAWHshow record log - [55]
VCNKFNUFapp init test - [56]
W4LFX7IHgroup diffs by file name - [57]
SWWE2R6Mdisplay basic repo stuff - [58]
YBJRDOTCmake all repo actions async - [59]
QMAUTRB6refactor diff - [60]
WXQBBQ2Aupdate nightly - [61]
JE44NYHMdisplay log files diffs - [62]
IQDCHWCPload a pijul repo - [63]
Z2CJPWZEfocus record message text_editor on spawn - [64]
KT5UYXGKfix selection after adding file, add changed file diffs - [65]
SEJXDXPWimprove file watcher to respect .ignore file - [66]
BFN2VHZSrefactor file stuff into sub-mod - [67]
S2NVIFXRallow to enter record msg - [68]
BJXUYQ2Yshow untracked file contents in read-only text editor - [69]
4ELJZGRJload and store all change diffs at once - [70]
C3OS2JJ6clear cache on saving record & refresh - [71]
PTWZYQFRuse nav-scrollable for repo status - [72]
YGZ3VCW4add push - [73]
OLDN7R34retry upsert project - [74]
6YZAVBWUInitial commit - [75]
WT3GA27Padd cursor with selection - [76]
Y5ATDI2Hconvert changed file diffs and load src only if any needs it - [77]
MJDGPSHGWIP contents diff - [78]
OPXFZKEBview tests setup - [79]
D7A7MSIHallow to defer or abandon record, add buttons
Change contents
- replacement in libflorescence/src/identity.rs at line 8
pub fn load() -> Id {let all = Id::load_all().unwrap();// TODO: handle identity creation if none foundall.into_iter().next().unwrap()pub fn load() -> anyhow::Result<Vec<Id>> {Id::load_all() - edit in inflorescence_view/src/view.rs at line 13
use libflorescence::identity::Id; - edit in inflorescence_view/src/view.rs at line 45
SelectIdentity(usize), - replacement in inflorescence_view/src/view.rs at line 229
ManagingRepoSubState::SelectingId {user_ids: _,user_selection_ix: _,user_selection_nav: _,ManagingRepoSubState::SelectingIdentity {ids,selection_ix,selection_nav,confirmed_selection_ix, - replacement in inflorescence_view/src/view.rs at line 235
} => todo!(),} => {let main = el(container(view_selecting_identity(ids,confirmed_selection_ix.unwrap_or_else(|| *selection_ix),selection_nav,)).width(Length::Fill).height(Length::Fill));add_actions_and_report(None,main,window_size,allowed_actions,report,)} - edit in inflorescence_view/src/view.rs at line 260
ManagingRepoSubState::NoIdFound { repo: _ } => {let main = el(container(text("No Pijul identity found. Create a new one in with Pijul CLI and then reload it here.")).width(Length::Fill).height(Length::Fill));add_actions_and_report(None,main,window_size,allowed_actions,report,)} - edit in inflorescence_view/src/view.rs at line 280
}fn view_selecting_identity<'a>(ids: &'a [Id],selection_ix: usize,selection_nav: &'a nav_scrollable::State,) -> Element<'a, Msg, Theme> {el(column([el(text("Select identity:")),el(nav_scrollable(selection_nav,ids.iter().enumerate().map(|(ix, id)| {el(button(text(id.name.to_string())).on_press(Msg::SelectIdentity(ix)).class(if ix == selection_ix {theme::Button::Selected} else {theme::Button::Normal}))}),)),])) - replacement in inflorescence_view/src/view/test.rs at line 50
user_ids: vec![],user_ids: None, - replacement in inflorescence_model/src/model.rs at line 99
user_ids: Vec<Id>,user_ids: Option<Vec<Id>>,repo: Option<repo::State>,},SelectingIdentity {ids: Vec<Id>,selection_ix: usize,selection_nav: nav_scrollable::State,// This will be set if confirmed before a repo is loadedconfirmed_selection_ix: Option<usize>, - replacement in inflorescence_model/src/model.rs at line 110
SelectingId {user_ids: Vec<Id>,user_selection_ix: usize,user_selection_nav: nav_scrollable::State,NoIdFound { - edit in inflorescence_model/src/action.rs at line 58
ReloadIdentity, - edit in inflorescence_model/src/action.rs at line 121
(ReloadIdentity, ReloadIdentity) => true, - edit in inflorescence_model/src/action.rs at line 143
(ReloadIdentity, _) => false, - replacement in inflorescence_model/src/action.rs at line 460
model::ManagingRepoSubState::SelectingId { .. } => todo!(),model::ManagingRepoSubState::SelectingIdentity { .. } => {vec![confirm("confirm"), down(), up()]} - edit in inflorescence_model/src/action.rs at line 466
model::ManagingRepoSubState::NoIdFound { .. } => vec![Binding {keys_str: "r",keys: ModKeys::One(ModKey {key: Key::Character("r".into()),mods: Mods::NONE,}),label: "Reload identity",msg: Some(FilteredMsg::ReloadIdentity),}], - replacement in inflorescence/src/test.rs at line 58
&& matches!(msg, Msg::ManagingRepo(ManagingRepoMsg::LoadedId(_)))&& matches!(msg,Msg::ManagingRepo(ManagingRepoMsg::LoadedIdentities(_))) - replacement in inflorescence/src/main.rs at line 112
LoadedId(Box<Id>),LoadedIdentities(anyhow::Result<Vec<Id>>), - replacement in inflorescence/src/main.rs at line 221[2.1997]→[3.531:639](∅→∅),[3.639]→[20.3611492:3611540](∅→∅),[4.4572]→[3.669:677](∅→∅),[6.25685]→[3.669:677](∅→∅),[20.3611540]→[3.669:677](∅→∅),[3.669]→[3.669:677](∅→∅)
let load_id_task = Task::future(async {let id = spawn_blocking(identity::load).await.unwrap();ManagingRepoMsg::LoadedId(Box::new(id))});let load_ids_task = load_identities_task(); - replacement in inflorescence/src/main.rs at line 227
load_id_task.map(Msg::ManagingRepo),load_ids_task.map(Msg::ManagingRepo), - replacement in inflorescence/src/main.rs at line 243
user_ids: Vec::new(),user_ids: None, - replacement in inflorescence/src/main.rs at line 469
| action::FilteredMsg::EnterSubMenu(_) => Task::none(),| action::FilteredMsg::EnterSubMenu(_)| action::FilteredMsg::ReloadIdentity => Task::none(), - replacement in inflorescence/src/main.rs at line 489
| view::Msg::ToRecord(_) => Task::none(),| view::Msg::ToRecord(_)| view::Msg::SelectIdentity(_) => Task::none(), - replacement in inflorescence/src/main.rs at line 573[21.21660]→[20.3613691:3613846](∅→∅),[20.3613691]→[20.3613691:3613846](∅→∅),[10.23975]→[9.80169:80301](∅→∅),[20.3613846]→[9.80169:80301](∅→∅),[9.80169]→[9.80169:80301](∅→∅)
ManagingRepoMsg::LoadedId(id) => {match &mut model.sub {model::ManagingRepoSubState::Loading { user_ids, repo } => {// TODO switch to `SelectingId` if more than one id foundif let Some(repo) = repo.take() {ManagingRepoMsg::LoadedIdentities(ids) => {match ids {Ok(mut user_ids) => {let get_repo = |sub: &mut model::ManagingRepoSubState| {match sub {model::ManagingRepoSubState::Loading {repo,..} => repo.take(),model::ManagingRepoSubState::SelectingIdentity {repo,..} => repo.take(),model::ManagingRepoSubState::NoIdFound { repo } => {repo.take()}model::ManagingRepoSubState::Ready(_) => {unreachable!()}}};if user_ids.is_empty() {let repo = get_repo(&mut model.sub); - replacement in inflorescence/src/main.rs at line 597
model::ManagingRepoSubState::Ready(ReadyState {user_id: *id,model::ManagingRepoSubState::NoIdFound { repo }} else if user_ids.len() == 1 {let user_id = user_ids.pop().unwrap();match &mut model.sub {model::ManagingRepoSubState::Loading {user_ids, - replacement in inflorescence/src/main.rs at line 604
selection: default(),navigation: default(),record_changes: default(),forking_channel_name: default(),logs: default(),to_record: default(),jobs: default(),})} => {if let Some(repo) = repo.take() {model.sub =model::ManagingRepoSubState::Ready(ReadyState {user_id,repo,selection: default(),navigation: default(),record_changes: default(),forking_channel_name: default(),logs: default(),to_record: default(),jobs: default(),},)} else {*user_ids = Some(vec![user_id]);}}model::ManagingRepoSubState::SelectingIdentity {..} => {unreachable!()}model::ManagingRepoSubState::Ready(..) => {unreachable!()}model::ManagingRepoSubState::NoIdFound {repo,} => {if let Some(repo) = repo.take() {model.sub =model::ManagingRepoSubState::Ready(ReadyState {user_id,repo,selection: default(),navigation: default(),record_changes: default(),forking_channel_name: default(),logs: default(),to_record: default(),jobs: default(),},)} else {model.sub = model::ManagingRepoSubState::SelectingIdentity {ids: user_ids,selection_ix: default(),selection_nav: default(),confirmed_selection_ix: default(),repo: default(),};}}} - replacement in inflorescence/src/main.rs at line 662
user_ids.push(*id);let repo = get_repo(&mut model.sub);model.sub =model::ManagingRepoSubState::SelectingIdentity {ids: user_ids,selection_ix: default(),selection_nav: default(),confirmed_selection_ix: default(),repo,} - replacement in inflorescence/src/main.rs at line 673[9.80845]→[20.3614460:3614564](∅→∅),[20.3614564]→[20.3614564:3614582](∅→∅),[20.3614582]→[20.3614582:3614642](∅→∅),[10.24172]→[9.80952:80987](∅→∅),[20.3614642]→[9.80952:80987](∅→∅),[9.80952]→[9.80952:80987](∅→∅)
model::ManagingRepoSubState::SelectingId { .. } => {unreachable!()}model::ManagingRepoSubState::Ready(..) => {unreachable!()Err(err) => {let msg =format!("Failed to load Pijul identity with {err:#?}");report::show_err(report, msg); - replacement in inflorescence/src/main.rs at line 993
| action::FilteredMsg::EnterSubMenu(_) => Task::none(),| action::FilteredMsg::EnterSubMenu(_)| action::FilteredMsg::ReloadIdentity => Task::none(), - replacement in inflorescence/src/main.rs at line 1009
| view::Msg::PickNewProject => Task::none(),| view::Msg::PickNewProject| view::Msg::SelectIdentity(_) => Task::none(), - edit in inflorescence/src/main.rs at line 1095
view::Msg::SelectIdentity(ix) => {if let model::ManagingRepoSubState::SelectingIdentity {ids,repo,confirmed_selection_ix,..} = &mut model.sub{if let Some(repo) = repo.take() {let user_id = ids.get(ix).unwrap().clone();model.sub =model::ManagingRepoSubState::Ready(ReadyState {user_id,repo,selection: default(),navigation: default(),record_changes: default(),forking_channel_name: default(),logs: default(),to_record: default(),jobs: default(),});} else {*confirmed_selection_ix = Some(ix);}}Task::none()} - edit in inflorescence/src/main.rs at line 1197
} else if let model::ManagingRepoSubState::SelectingIdentity {ids,selection_ix,selection_nav: _,confirmed_selection_ix,repo,} = &mut model.sub{if let Some(repo) = repo.take() {let user_id = ids.get(*selection_ix).unwrap().clone();model.sub =model::ManagingRepoSubState::Ready(ReadyState {user_id,repo,selection: default(),navigation: default(),record_changes: default(),forking_channel_name: default(),logs: default(),to_record: default(),jobs: default(),});} else {*confirmed_selection_ix = Some(*selection_ix);}Task::none() - edit in inflorescence/src/main.rs at line 1278
} else if let model::ManagingRepoSubState::SelectingIdentity {ids,selection_ix,selection_nav: _,confirmed_selection_ix,repo: _,} = &mut model.sub{match msg {selection::Msg::PressDir(dir) => match dir {inflorescence_model::selection::Dir::Down => {*confirmed_selection_ix = None;if *selection_ix == ids.len().saturating_sub(1) {*selection_ix = 0;} else {*selection_ix += 1;}}inflorescence_model::selection::Dir::Up => {*confirmed_selection_ix = None;if *selection_ix == 0 {*selection_ix = ids.len().saturating_sub(1);} else {*selection_ix -= 1;}}inflorescence_model::selection::Dir::Right| inflorescence_model::selection::Dir::Left => {}},selection::Msg::AltPressDir(_) => {}}Task::none() - edit in inflorescence/src/main.rs at line 1437
action::FilteredMsg::ReloadIdentity => {load_identities_task().map(Msg::ManagingRepo)} - edit in inflorescence/src/main.rs at line 1554
}fn load_identities_task() -> Task<ManagingRepoMsg> {Task::future(async {let ids = spawn_blocking(identity::load).await.unwrap();ManagingRepoMsg::LoadedIdentities(ids)}) - replacement in inflorescence/src/main.rs at line 2155[20.3623971]→[20.3623971:3624020](∅→∅),[13.14403]→[9.90921:90976](∅→∅),[20.3624020]→[9.90921:90976](∅→∅),[9.90921]→[9.90921:90976](∅→∅),[9.90976]→[20.3624021:3624085](∅→∅),[10.26488]→[9.91022:91174](∅→∅),[20.3624085]→[9.91022:91174](∅→∅),[9.91022]→[9.91022:91174](∅→∅),[9.91174]→[13.14404:14451](∅→∅),[13.14451]→[9.91217:91307](∅→∅),[9.91217]→[9.91217:91307](∅→∅),[9.91307]→[16.18196:18238](∅→∅),[16.18238]→[17.9125:9162](∅→∅),[17.9162]→[9.91307:91347](∅→∅),[16.18238]→[9.91307:91347](∅→∅),[9.91307]→[9.91307:91347](∅→∅),[9.91347]→[20.3624086:3624145](∅→∅),[10.26536]→[9.91388:91584](∅→∅),[20.3624145]→[9.91388:91584](∅→∅),[9.91388]→[9.91388:91584](∅→∅)
model.sub = if user_ids.len() == 1 {let user_id = user_ids.pop().unwrap();model::ManagingRepoSubState::Ready(ReadyState {user_id,repo: repo_state,selection: default(),navigation: default(),record_changes: default(),forking_channel_name: default(),logs: default(),to_record: default(),jobs: default(),})} else {model::ManagingRepoSubState::SelectingId {user_ids: mem::take(user_ids),user_selection_ix: default(),user_selection_nav: default(),repo: Some(repo_state),if let Some(user_ids) = user_ids {model.sub = if user_ids.len() == 1 {let user_id = user_ids.pop().unwrap();model::ManagingRepoSubState::Ready(ReadyState {user_id,repo: repo_state,selection: default(),navigation: default(),record_changes: default(),forking_channel_name: default(),logs: default(),to_record: default(),jobs: default(),})} else {model::ManagingRepoSubState::SelectingIdentity {ids: mem::take(user_ids),selection_ix: default(),selection_nav: default(),confirmed_selection_ix: default(),repo: Some(repo_state),} - replacement in inflorescence/src/main.rs at line 2180
model::ManagingRepoSubState::SelectingId { repo, .. } => {model::ManagingRepoSubState::SelectingIdentity { repo, .. } => { - edit in inflorescence/src/main.rs at line 2184
model::ManagingRepoSubState::NoIdFound { repo } => {*repo = Some(repo_state)} - replacement in inflorescence/src/main.rs at line 2269
model::ManagingRepoSubState::SelectingId { repo, .. } => {model::ManagingRepoSubState::SelectingIdentity { repo, .. } => { - edit in inflorescence/src/main.rs at line 2295
}model::ManagingRepoSubState::NoIdFound { repo } => {*repo = Some(repo_state)