Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/skillpouch/src/commands/logout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub async fn forget(ctx: &Context, credentials: Credentials) -> Result<()> {
if !revoked {
ui::warn(format!(
"Couldn't reach the server. Remove this computer on your Devices page: {}",
ui::accent(format!("{}/app/account/devices", credentials.api_url))
ui::accent(format!("{}/account/devices", credentials.api_url))
));
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion crates/skillpouch/src/notify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ mod tests {
status.conflicts = 2;
let (title, body) = news(&mut status, "https://x").unwrap_or_default();
assert_eq!(title, "SkillPouch: 2 items changed in two places");
assert!(body.ends_with("https://x/app/p/p1/conflicts"), "{body}");
assert!(body.ends_with("https://x/pouches/p1/conflicts"), "{body}");
assert_eq!(news(&mut status, "https://x"), None);
// Resolved, then a new one: told again.
status.conflicts = 0;
Expand Down
2 changes: 1 addition & 1 deletion crates/skillpouch/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn backups_dir(ctx: &Context) -> PathBuf {

/// Where the web app resolves a pouch's conflicts.
pub fn conflicts_path(pouch_id: &str) -> String {
format!("/app/p/{pouch_id}/conflicts")
format!("/pouches/{pouch_id}/conflicts")
}

/// `1 item`, `3 items`.
Expand Down
18 changes: 9 additions & 9 deletions crates/sp-tui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,15 @@ impl App {
/// Where `o` goes from the current tab.
fn web_path(&self) -> String {
match self.tab {
Tab::Overview => "/app".into(),
Tab::Usage => "/app/account/usage".into(),
Tab::Overview => "/pouches".into(),
Tab::Usage => "/account/usage".into(),
Tab::Pouches => self
.dashboard()
.and_then(|d| d.pouches.get(self.cursor(Tab::Pouches)))
.map_or("/app".into(), |pouch| format!("/app/p/{}", pouch.id)),
Tab::Sync => "/app".into(),
Tab::Computers => "/app/account/devices".into(),
Tab::Account => "/app/account".into(),
.map_or("/pouches".into(), |pouch| format!("/pouches/{}", pouch.id)),
Tab::Sync => "/pouches".into(),
Tab::Computers => "/account/devices".into(),
Tab::Account => "/account".into(),
}
}

Expand Down Expand Up @@ -496,8 +496,8 @@ impl App {
KeyCode::Enter if self.tab == Tab::Account => {
match AccountAction::ALL.get(self.cursor(Tab::Account)) {
Some(AccountAction::SetUp) => Outcome::Send(Request::Setup),
Some(AccountAction::OpenAccount) => self.open("/app/account"),
Some(AccountAction::OpenBilling) => self.open("/app/account/billing"),
Some(AccountAction::OpenAccount) => self.open("/account"),
Some(AccountAction::OpenBilling) => self.open("/account/billing"),
Some(AccountAction::Logout) => {
self.confirm_logout = true;
Outcome::Nothing
Expand Down Expand Up @@ -760,7 +760,7 @@ pub(crate) mod tests {
assert_eq!(
press(&mut app, KeyCode::Char('o')),
Outcome::Send(Request::Open(
"https://app.skillpouch.net/app/p/0193ab12-0000-7000-8000-000000000002".into()
"https://app.skillpouch.net/pouches/0193ab12-0000-7000-8000-000000000002".into()
))
);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/sp-tui/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub enum Request {
},
/// Make this pouch the one this computer syncs.
UsePouch(String),
/// Open a web app path (`/app/account`) in the browser.
/// Open a web app path (`/account`) in the browser.
Open(String),
/// Look at this computer's assistants and set it up.
Setup,
Expand Down
4 changes: 2 additions & 2 deletions crates/sp-tui/src/view/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ pub(crate) mod tests {
detail: Some(
"1 item changed in two places: press c to pick versions in the web app".into(),
),
conflicts: Some("/app/p/p1/conflicts".into()),
conflicts: Some("/pouches/p1/conflicts".into()),
})));
contains_all(
&screen(&app, 120, 40),
Expand All @@ -344,7 +344,7 @@ pub(crate) mod tests {
let key = KeyEvent::new(KeyCode::Char('c'), KeyModifiers::NONE);
assert!(matches!(
app.on_key(key),
crate::app::Outcome::Send(crate::model::Request::Open(url)) if url == "https://app.skillpouch.net/app/p/p1/conflicts"
crate::app::Outcome::Send(crate::model::Request::Open(url)) if url == "https://app.skillpouch.net/pouches/p1/conflicts"
));
}

Expand Down
Loading