Fit the home page on one screen; phone home and tabs; icon shapes
The home column is as tall as the window (banner, friends, live rooms, servers and recent chats), as in the design. On the phone the friends are smaller bubbles, the title says the app's name and the bottom navigation marks Home while the home, friends, messages or Library page is shown. One-line previews leave out emoji (plain text draws none). Icons whose Lucide data spans several lines were written empty; they are complete now. Sample contacts stay when the engine reports its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No files matched your search
@@ -893,6 +893,8 @@ impl App {
|
||||
Event::Transfer { session, transfer, state } => {
|
||||
self.transfer_progress(session as i64, transfer, state);
|
||||
}
|
||||
// The engine's contacts would replace the sample ones.
|
||||
Event::ContactsChanged { .. } if self.demo_ui && !self.contacts.is_empty() => {}
|
||||
Event::ContactsChanged { contacts } => {
|
||||
self.contacts = contacts.iter().map(|c| (c.uid.clone(), c.clone())).collect();
|
||||
self.refresh_member_card();
|
||||
|
||||
@@ -66,9 +66,17 @@ pub fn plain(text: &str) -> String {
|
||||
}
|
||||
}
|
||||
out.push_str(rest);
|
||||
// Plain text draws no emoji (they are pictures in the chat): leave
|
||||
// them out of one-line previews.
|
||||
let out: String = out.chars().filter(|c| !is_emoji(*c)).collect();
|
||||
out.split_whitespace().collect::<Vec<_>>().join(" ")
|
||||
}
|
||||
|
||||
/// Pictographs, symbols and their joiners and variation selectors.
|
||||
fn is_emoji(c: char) -> bool {
|
||||
matches!(u32::from(c), 0x1F000..=0x1FAFF | 0x2600..=0x27BF | 0xFE0F | 0x200D)
|
||||
}
|
||||
|
||||
/// `b`, `/url`, `URL=https://…`, `color=#f00`: a BBCode tag.
|
||||
fn is_tag(inside: &str) -> bool {
|
||||
let name = inside.strip_prefix('/').unwrap_or(inside);
|
||||
@@ -195,6 +203,7 @@ mod tests {
|
||||
assert_eq!(plain("see [URL=https://x.org]this[/URL]"), "see this");
|
||||
assert_eq!(plain("a [not a tag here] b"), "a [not a tag here] b");
|
||||
assert_eq!(plain("[1] item"), "[1] item");
|
||||
assert_eq!(plain("later? 👀 Posting ❤️"), "later? Posting");
|
||||
assert_eq!(preview("Hello", true, &[]), "You: Hello");
|
||||
let file = |name: &str| voelin_model::FileRef { name: name.into(), ..Default::default() };
|
||||
assert_eq!(
|
||||
|
||||
@@ -219,11 +219,14 @@ export component MainWindow inherits Window {
|
||||
: Nav.page == Page.messages ? @tr("Messages")
|
||||
: Nav.page == Page.library ? @tr("Library")
|
||||
: Nav.page == Page.events ? @tr("Events")
|
||||
: Nav.mobile-tab == MobileTab.home ? Bridge.app-name
|
||||
: Nav.page == Page.home || Nav.mobile-tab == MobileTab.home ? Bridge.app-name
|
||||
: Nav.mobile-tab == MobileTab.you ? @tr("You")
|
||||
: Nav.mobile-tab == MobileTab.activity ? @tr("Activity")
|
||||
: Bridge.server-title;
|
||||
subtitle: Nav.page == Page.settings ? "" : Nav.mobile-tab == MobileTab.chat && Bridge.current-tab >= 0 && Bridge.current-tab < Bridge.tabs.length ? Bridge.tabs[Bridge.current-tab].title : Nav.mobile-tab == MobileTab.servers ? Bridge.server-stats : "";
|
||||
subtitle: Nav.page == Page.settings || Nav.page == Page.friends || Nav.page == Page.messages || Nav.page == Page.library ? ""
|
||||
: Nav.page == Page.home || Nav.mobile-tab == MobileTab.home ? @tr("Find your people. Talk beyond.")
|
||||
: Nav.page == Page.events ? Bridge.server-title
|
||||
: Nav.mobile-tab == MobileTab.chat && Bridge.current-tab >= 0 && Bridge.current-tab < Bridge.tabs.length ? Bridge.tabs[Bridge.current-tab].title : Nav.mobile-tab == MobileTab.servers ? Bridge.server-stats : "";
|
||||
back: Nav.page == Page.settings || Nav.page == Page.friends || Nav.page == Page.messages || Nav.page == Page.library || Nav.page == Page.events;
|
||||
unread: Bridge.unread-total;
|
||||
go-back => {
|
||||
|
||||
@@ -13,5 +13,6 @@
|
||||
>
|
||||
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
|
||||
<path d="M22 8c0-2.3-.8-4.3-2-6" />
|
||||
<path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" />
|
||||
<path d="M4 2C2.8 3.7 2 5.7 2 8" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 408 B After Width: | Height: | Size: 549 B |
@@ -11,6 +11,7 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z" />
|
||||
<path d="m6.2 5.3 3.1 3.9" />
|
||||
<path d="m12.4 3.4 3.1 4" />
|
||||
<path d="M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z" />
|
||||
|
||||
|
Before Width: | Height: | Size: 411 B After Width: | Height: | Size: 498 B |
@@ -11,6 +11,7 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2" />
|
||||
<path d="M6.453 15h11.094" />
|
||||
<path d="M8.5 2h7" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 348 B After Width: | Height: | Size: 467 B |
@@ -11,5 +11,5 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
|
||||
<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 419 B |
@@ -12,4 +12,5 @@
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<polyline points="22 12 16 12 14 15 10 15 8 12 2 12" />
|
||||
<path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 342 B After Width: | Height: | Size: 464 B |
@@ -11,5 +11,6 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z" />
|
||||
<circle cx="16.5" cy="7.5" r=".5" fill="currentColor" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 533 B |
@@ -11,6 +11,7 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z" />
|
||||
<path d="M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14" />
|
||||
<path d="M8 6v8" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 511 B |
@@ -11,6 +11,7 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" />
|
||||
<path d="M12 8v6" />
|
||||
<path d="M9 11h6" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 475 B |
@@ -13,5 +13,6 @@
|
||||
>
|
||||
<path d="M12 22v-5" />
|
||||
<path d="M15 8V2" />
|
||||
<path d="M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z" />
|
||||
<path d="M9 8V2" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 438 B |
@@ -14,4 +14,5 @@
|
||||
<path d="M15 12h-5" />
|
||||
<path d="M15 8h-5" />
|
||||
<path d="M19 17V5a2 2 0 0 0-2-2H4" />
|
||||
<path d="M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 501 B |
@@ -11,6 +11,7 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72" />
|
||||
<path d="m14 7 3 3" />
|
||||
<path d="M5 6v4" />
|
||||
<path d="M19 14v4" />
|
||||
|
||||
|
Before Width: | Height: | Size: 456 B After Width: | Height: | Size: 613 B |
@@ -11,5 +11,5 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
|
||||
<path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 453 B |
@@ -208,7 +208,7 @@ component HomeBanner inherits Rectangle {
|
||||
property <int> slide: 0;
|
||||
property <int> count: Bridge.servers.length + 1;
|
||||
property <ServerItem> server: Bridge.servers[max(0, root.slide - 1)];
|
||||
min-height: compact ? 200px : 236px;
|
||||
min-height: compact ? 200px : 212px;
|
||||
border-radius: Theme.radius-xl;
|
||||
clip: true;
|
||||
background: root.slide == 0
|
||||
@@ -363,8 +363,10 @@ component HomeBanner inherits Rectangle {
|
||||
// A friend in the "Friends Online" row.
|
||||
component FriendBubble inherits Rectangle {
|
||||
in property <ContactItem> friend;
|
||||
width: 88px;
|
||||
height: 128px;
|
||||
// The phone: smaller, the name only.
|
||||
in property <bool> compact;
|
||||
width: compact ? 62px : 88px;
|
||||
height: compact ? 80px : 118px;
|
||||
accessible-role: AccessibleRole.button;
|
||||
accessible-label: friend.name;
|
||||
accessible-description: friend.status;
|
||||
@@ -382,7 +384,7 @@ component FriendBubble inherits Rectangle {
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
Avatar {
|
||||
size: 60px;
|
||||
size: root.compact ? 50px : 60px;
|
||||
initials: root.friend.initials;
|
||||
tint: root.friend.tint;
|
||||
image: root.friend.avatar;
|
||||
@@ -401,14 +403,19 @@ component FriendBubble inherits Rectangle {
|
||||
horizontal-alignment: center;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: root.friend.status;
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
horizontal-alignment: center;
|
||||
wrap: word-wrap;
|
||||
overflow: elide;
|
||||
max-height: 30px * Theme.font-scale;
|
||||
// Two lines at most.
|
||||
if !root.compact: Rectangle {
|
||||
height: 27px * Theme.font-scale;
|
||||
clip: true;
|
||||
Text {
|
||||
y: 0;
|
||||
width: parent.width;
|
||||
text: root.friend.status;
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
horizontal-alignment: center;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,7 +424,7 @@ component FriendBubble inherits Rectangle {
|
||||
component LiveCard inherits Rectangle {
|
||||
in property <LiveItem> room;
|
||||
width: 256px;
|
||||
height: 182px;
|
||||
height: 170px;
|
||||
border-radius: Theme.radius-lg;
|
||||
clip: true;
|
||||
background: Theme.surface-2;
|
||||
@@ -434,7 +441,7 @@ component LiveCard inherits Rectangle {
|
||||
// The picture: the server's colour, a sky and the kind of stream.
|
||||
Rectangle {
|
||||
y: 0;
|
||||
height: 112px;
|
||||
height: 104px;
|
||||
background: @linear-gradient(150deg, root.room.backdrop.darker(0.2) 0%, #1c1470 60%, #070c1d 100%);
|
||||
Stars { }
|
||||
Icon {
|
||||
@@ -490,8 +497,8 @@ component LiveCard inherits Rectangle {
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
y: 112px;
|
||||
height: parent.height - 112px;
|
||||
y: 104px;
|
||||
height: parent.height - 104px;
|
||||
padding: Theme.space-3;
|
||||
spacing: Theme.space-2;
|
||||
HorizontalLayout {
|
||||
@@ -537,7 +544,7 @@ component ServerCard inherits Rectangle {
|
||||
min-width: 180px;
|
||||
max-width: 280px;
|
||||
horizontal-stretch: 1;
|
||||
height: 172px;
|
||||
height: 158px;
|
||||
border-radius: Theme.radius-lg;
|
||||
clip: true;
|
||||
background: Theme.surface-2;
|
||||
@@ -770,7 +777,7 @@ export component HomePage inherits Rectangle {
|
||||
VerticalLayout {
|
||||
width: sv.visible-width;
|
||||
padding: root.compact ? Theme.space-4 : Theme.space-4;
|
||||
spacing: root.compact ? Theme.space-4 : Theme.space-5;
|
||||
spacing: Theme.space-4;
|
||||
alignment: start;
|
||||
HomeBanner {
|
||||
compact: root.compact;
|
||||
@@ -778,7 +785,7 @@ export component HomePage inherits Rectangle {
|
||||
Section {
|
||||
text: @tr("Friends Online");
|
||||
icon: Icons.users;
|
||||
action: @tr("View All ({})", Bridge.contacts-online);
|
||||
action: @tr("View All ({})", Bridge.friends-online.length);
|
||||
action-clicked => {
|
||||
Nav.friends-tab = 0;
|
||||
Bridge.friends-tab(0);
|
||||
@@ -792,7 +799,7 @@ export component HomePage inherits Rectangle {
|
||||
wrap: word-wrap;
|
||||
}
|
||||
if Bridge.friends-online.length > 0: Flickable {
|
||||
height: 128px;
|
||||
height: root.compact ? 80px : 118px;
|
||||
content-width: max(self.width, friends-row.preferred-width);
|
||||
content-height: self.height;
|
||||
friends-row := HorizontalLayout {
|
||||
@@ -800,9 +807,10 @@ export component HomePage inherits Rectangle {
|
||||
alignment: start;
|
||||
for friend in Bridge.friends-online: FriendBubble {
|
||||
friend: friend;
|
||||
compact: root.compact;
|
||||
}
|
||||
// Find friends.
|
||||
Rectangle {
|
||||
if !root.compact: Rectangle {
|
||||
width: 88px;
|
||||
accessible-role: AccessibleRole.button;
|
||||
accessible-label: @tr("Find Friends");
|
||||
@@ -861,7 +869,7 @@ export component HomePage inherits Rectangle {
|
||||
wrap: word-wrap;
|
||||
}
|
||||
live-list := Flickable {
|
||||
height: Bridge.live-rooms.length > 0 ? 182px : 0px;
|
||||
height: Bridge.live-rooms.length > 0 ? 170px : 0px;
|
||||
content-width: max(self.width, live-row.preferred-width);
|
||||
content-height: self.height;
|
||||
live-row := HorizontalLayout {
|
||||
|
||||
@@ -387,11 +387,6 @@ component CameraCard inherits Card {
|
||||
Bridge.video-changed(Bridge.video);
|
||||
}
|
||||
}
|
||||
Button {
|
||||
icon: Icons.settings;
|
||||
text: @tr("Camera Settings");
|
||||
clicked => { Nav.open-settings(SettingsSection.devices); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -164,34 +164,34 @@ export component MobileShell inherits Rectangle {
|
||||
NavTab {
|
||||
icon: Icons.home;
|
||||
text: @tr("Home");
|
||||
selected: Nav.mobile-tab == MobileTab.home && Nav.page != Page.settings;
|
||||
selected: Nav.page == Page.home || Nav.page == Page.friends || Nav.page == Page.messages || Nav.page == Page.library || (Nav.mobile-tab == MobileTab.home && Nav.page == Page.server);
|
||||
clicked => { Nav.show(Page.home); Nav.mobile-tab = MobileTab.home; }
|
||||
}
|
||||
NavTab {
|
||||
icon: Icons.server;
|
||||
text: @tr("Servers");
|
||||
selected: Nav.mobile-tab == MobileTab.servers && Nav.page != Page.settings;
|
||||
selected: (Nav.mobile-tab == MobileTab.servers && Nav.page == Page.server) || Nav.page == Page.events;
|
||||
dot: Bridge.voice-connected;
|
||||
clicked => { Nav.show(Page.server); Nav.mobile-tab = MobileTab.servers; }
|
||||
}
|
||||
NavTab {
|
||||
icon: Bridge.viewer-open ? Icons.monitor : Icons.message-circle;
|
||||
text: Bridge.viewer-open ? @tr("Stream") : @tr("Chat");
|
||||
selected: Nav.mobile-tab == MobileTab.chat && Nav.page != Page.settings;
|
||||
selected: Nav.mobile-tab == MobileTab.chat && Nav.page == Page.server;
|
||||
badge: root.unread;
|
||||
clicked => { Nav.show(Page.server); Nav.mobile-tab = MobileTab.chat; }
|
||||
}
|
||||
NavTab {
|
||||
icon: Icons.activity;
|
||||
text: @tr("Activity");
|
||||
selected: Nav.mobile-tab == MobileTab.activity && Nav.page != Page.settings;
|
||||
selected: Nav.mobile-tab == MobileTab.activity && Nav.page == Page.server;
|
||||
badge: Bridge.share-requests;
|
||||
clicked => { Nav.show(Page.server); Nav.mobile-tab = MobileTab.activity; }
|
||||
}
|
||||
NavTab {
|
||||
icon: Icons.user;
|
||||
text: @tr("You");
|
||||
selected: Nav.mobile-tab == MobileTab.you || Nav.page == Page.settings;
|
||||
selected: (Nav.mobile-tab == MobileTab.you && Nav.page == Page.server) || Nav.page == Page.settings;
|
||||
clicked => { Nav.show(Page.server); Nav.mobile-tab = MobileTab.you; }
|
||||
}
|
||||
}
|
||||
|
||||