Rename SharedUrl to SharedUri (#7084)

This PR renames `SharedUrl` to `SharedUri` to better reflect its intent.

I'm still not entirely happy with this naming, as the file paths that we
can store in here are not _really_ URIs, as they are lacking a protocol.

I want to explore changing `SharedUri` / `SharedUrl` back to alway
storing a URL and treat local filepaths differently, as it seems we're
conflating two different concerns under the same umbrella, at the
moment.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-01-30 09:54:23 -05:00 committed by GitHub
parent d18c0d9df0
commit 6c7893db35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 66 additions and 66 deletions

View file

@ -714,7 +714,7 @@ fn format_timestamp(
#[cfg(test)]
mod tests {
use super::*;
use gpui::{HighlightStyle, SharedUrl};
use gpui::{HighlightStyle, SharedUri};
use pretty_assertions::assert_eq;
use rich_text::Highlight;
use time::{Date, OffsetDateTime, Time, UtcOffset};
@ -730,7 +730,7 @@ mod tests {
timestamp: OffsetDateTime::now_utc(),
sender: Arc::new(client::User {
github_login: "fgh".into(),
avatar_uri: SharedUrl::network("avatar_fgh"),
avatar_uri: SharedUri::network("avatar_fgh"),
id: 103,
}),
nonce: 5,

View file

@ -365,7 +365,7 @@ impl Render for MessageEditor {
mod tests {
use super::*;
use client::{Client, User, UserStore};
use gpui::{SharedUrl, TestAppContext};
use gpui::{SharedUri, TestAppContext};
use language::{Language, LanguageConfig};
use rpc::proto;
use settings::SettingsStore;
@ -392,7 +392,7 @@ mod tests {
user: Arc::new(User {
github_login: "a-b".into(),
id: 101,
avatar_uri: SharedUrl::network("avatar_a-b"),
avatar_uri: SharedUri::network("avatar_a-b"),
}),
kind: proto::channel_member::Kind::Member,
role: proto::ChannelRole::Member,
@ -401,7 +401,7 @@ mod tests {
user: Arc::new(User {
github_login: "C_D".into(),
id: 102,
avatar_uri: SharedUrl::network("avatar_C_D"),
avatar_uri: SharedUri::network("avatar_C_D"),
}),
kind: proto::channel_member::Kind::Member,
role: proto::ChannelRole::Member,

View file

@ -1,10 +1,10 @@
use gpui::{img, prelude::*, AnyElement, SharedUrl};
use gpui::{img, prelude::*, AnyElement, SharedUri};
use smallvec::SmallVec;
use ui::prelude::*;
#[derive(IntoElement)]
pub struct CollabNotification {
avatar_uri: SharedUrl,
avatar_uri: SharedUri,
accept_button: Button,
dismiss_button: Button,
children: SmallVec<[AnyElement; 2]>,
@ -12,7 +12,7 @@ pub struct CollabNotification {
impl CollabNotification {
pub fn new(
avatar_uri: impl Into<SharedUrl>,
avatar_uri: impl Into<SharedUri>,
accept_button: Button,
dismiss_button: Button,
) -> Self {

View file

@ -1,4 +1,4 @@
use gpui::{prelude::*, SharedUrl};
use gpui::{prelude::*, SharedUri};
use story::{StoryContainer, StoryItem, StorySection};
use ui::prelude::*;
@ -19,7 +19,7 @@ impl Render for CollabNotificationStory {
"Incoming Call Notification",
window_container(400., 72.).child(
CollabNotification::new(
SharedUrl::network("https://avatars.githubusercontent.com/u/1486634?v=4"),
SharedUri::network("https://avatars.githubusercontent.com/u/1486634?v=4"),
Button::new("accept", "Accept"),
Button::new("decline", "Decline"),
)
@ -36,7 +36,7 @@ impl Render for CollabNotificationStory {
"Project Shared Notification",
window_container(400., 72.).child(
CollabNotification::new(
SharedUrl::network("https://avatars.githubusercontent.com/u/1714999?v=4"),
SharedUri::network("https://avatars.githubusercontent.com/u/1714999?v=4"),
Button::new("open", "Open"),
Button::new("dismiss", "Dismiss"),
)