forge
Explore
Log in

Don't you dare go Hollow

Stream audio line per screen share in voice panel, harness on its own port

Browse files at this commit

6d19ee2f0dec3e60a10159e8a9dd12d448602603Ahmet Kaan GümüşParent: 9e0576c
  • feat
    • stream audio line per screen share in voice panel, harness on its own port
Show full message
✨ feat: stream audio line per screen share in voice panel, harness on its own port
crates/client/src/gui/sidebar.rsmodified+30 -10
@@ -240,7 +240,7 @@ impl Yumush {
240240 let screen = self.chat.share_of(community_id, user.id, Kind::Screen).is_some();
241241 let camera = self.chat.share_of(community_id, user.id, Kind::Camera).is_some();
242242
243- profile_popover(
243+ let member = profile_popover(
244244 format!("voice_member_{}", user.id),
245245 Anchor::BottomLeft,
246246 user,
@@ -272,14 +272,6 @@ impl Yumush {
272272 .text_color(palette.text)
273273 .child(user.username.clone()),
274274 )
275- .when(screen, |row| {
276- row.child(
277- Icon::new(IconName::ScreenShare)
278- .w(px(12.))
279- .h(px(12.))
280- .text_color(palette.alert),
281- )
282- })
283275 .when(camera, |row| {
284276 row.child(
285277 Icon::new(IconName::Video)
@@ -289,7 +281,35 @@ impl Yumush {
289281 )
290282 })
291283 .child(wave_slot(self.chat.waves.voice(user.id), 12., palette.ok)),
292- )
284+ );
285+ let user_id = user.id;
286+ let watch = entity.clone();
287+
288+ div().flex().flex_col().child(member).when(screen, |column| {
289+ column.child(
290+ clickable(format!("voice_screen_{user_id}"), palette, move |window, cx| {
291+ watch.update(cx, |yumush, cx| {
292+ yumush.toggle_viewer(user_id, Kind::Screen, window, cx)
293+ });
294+ })
295+ .tip("Watch")
296+ .ml(px(28.))
297+ .px(px(4.))
298+ .py(px(2.))
299+ .flex()
300+ .items_center()
301+ .gap(px(6.))
302+ .rounded(px(6.))
303+ .child(
304+ Icon::new(IconName::ScreenShare)
305+ .w(px(12.))
306+ .h(px(12.))
307+ .text_color(palette.alert),
308+ )
309+ .child(div().flex_1())
310+ .child(wave_slot(self.chat.waves.share(user_id), 12., palette.alert)),
311+ )
312+ })
293313 }
294314
295315 fn voice_dot(&self, entity: &Entity<Self>, palette: Palette) -> Option<impl IntoElement> {
crates/client/src/lib.rsmodified+2 -1
@@ -63,7 +63,8 @@ impl Default for ClientConfig {
6363 let config = Config::parse(CLIENT_CONFIG_FILE_CONTENT).expect("client config");
6464
6565 Self {
66- server_address: config.get("server_address").expect("server_address"),
66+ server_address: std::env::var("YUMUSH_SERVER_ADDRESS")
67+ .unwrap_or_else(|_| config.get("server_address").expect("server_address")),
6768 server_name: config.get("server_name").expect("server_name"),
6869 }
6970 }
harness/client.shmodified+1 -1
@@ -6,6 +6,6 @@ STATE="${HARNESS_STATE:-/tmp/claude-1000/yumush-harness}"
66 NAME="$1"
77 source "${ENV_FILE:-$STATE/env}"
88 mkdir -p "$STATE/clients/$NAME"
9-XDG_CONFIG_HOME="$STATE/clients/$NAME" RUST_LOG="${RUST_LOG:-info}" "$ROOT/target/${PROFILE:-harness}/client" >"$STATE/$NAME.log" 2>&1 &
9+YUMUSH_SERVER_ADDRESS="127.0.0.1:${HARNESS_PORT:-2027}" XDG_CONFIG_HOME="$STATE/clients/$NAME" RUST_LOG="${RUST_LOG:-info}" "$ROOT/target/${PROFILE:-harness}/client" >"$STATE/$NAME.log" 2>&1 &
1010 echo "$NAME $!" >> "$STATE/pids"
1111 echo "$NAME $!"
harness/up.shmodified+2 -1
@@ -6,8 +6,9 @@ STATE="${HARNESS_STATE:-/tmp/claude-1000/yumush-harness}"
66 [ -e "$STATE/pids" ] && { echo "harness already up: $STATE"; exit 1; }
77 mkdir -p "$STATE/server" "$STATE/xdg/xdg-desktop-portal" "$STATE/shots"
88 cp "$ROOT/fullchain.pem" "$ROOT/privkey.pem" "$STATE/server/"
9+printf '[server_config]\ndatabase_path = "yumush.db"\nserver_address = "127.0.0.1:%s"\ncertificate_path = "fullchain.pem"\nkey_path = "privkey.pem"\n' "${HARNESS_PORT:-2027}" > "$STATE/server/server_config.toml"
910 cp "$HERE/portals.conf" "$STATE/xdg/xdg-desktop-portal/niri-portals.conf"
10-(cd "$STATE/server" && exec "$ROOT/target/${PROFILE:-harness}/server" >"$STATE/server.log" 2>&1) &
11+(cd "$STATE/server" && YUMUSH_CONFIG_DIR="$STATE/server" exec "$ROOT/target/${PROFILE:-harness}/server" >"$STATE/server.log" 2>&1) &
1112 echo "server $!" >> "$STATE/pids"
1213 dbus-run-session -- "$HERE/session.sh" "$STATE" >"$STATE/session.log" 2>&1 &
1314 echo "session $!" >> "$STATE/pids"