Stream audio line per screen share in voice panel, harness on its own port
Browse files at this commit6d19ee2f0dec3e60a10159e8a9dd12d448602603Parent: 9e0576c- feat
- stream audio line per screen share in voice panel, harness on its own port
4 changed files +35 -13
- crates/client/src/gui/sidebar.rs +30 -10
- crates/client/src/lib.rs +2 -1
- harness/client.sh +1 -1
- harness/up.sh +2 -1
crates/client/src/gui/sidebar.rsmodified+30 -10
| @@ -240,7 +240,7 @@ impl Yumush { | ||
| 240 | 240 | let screen = self.chat.share_of(community_id, user.id, Kind::Screen).is_some(); |
| 241 | 241 | let camera = self.chat.share_of(community_id, user.id, Kind::Camera).is_some(); |
| 242 | 242 | |
| 243 | - profile_popover( | |
| 243 | + let member = profile_popover( | |
| 244 | 244 | format!("voice_member_{}", user.id), |
| 245 | 245 | Anchor::BottomLeft, |
| 246 | 246 | user, |
| @@ -272,14 +272,6 @@ impl Yumush { | ||
| 272 | 272 | .text_color(palette.text) |
| 273 | 273 | .child(user.username.clone()), |
| 274 | 274 | ) |
| 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 | - }) | |
| 283 | 275 | .when(camera, |row| { |
| 284 | 276 | row.child( |
| 285 | 277 | Icon::new(IconName::Video) |
| @@ -289,7 +281,35 @@ impl Yumush { | ||
| 289 | 281 | ) |
| 290 | 282 | }) |
| 291 | 283 | .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 | + }) | |
| 293 | 313 | } |
| 294 | 314 | |
| 295 | 315 | 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 { | ||
| 63 | 63 | let config = Config::parse(CLIENT_CONFIG_FILE_CONTENT).expect("client config"); |
| 64 | 64 | |
| 65 | 65 | 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")), | |
| 67 | 68 | server_name: config.get("server_name").expect("server_name"), |
| 68 | 69 | } |
| 69 | 70 | } |
harness/client.shmodified+1 -1
| @@ -6,6 +6,6 @@ STATE="${HARNESS_STATE:-/tmp/claude-1000/yumush-harness}" | ||
| 6 | 6 | NAME="$1" |
| 7 | 7 | source "${ENV_FILE:-$STATE/env}" |
| 8 | 8 | 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 & | |
| 10 | 10 | echo "$NAME $!" >> "$STATE/pids" |
| 11 | 11 | echo "$NAME $!" |
harness/up.shmodified+2 -1
| @@ -6,8 +6,9 @@ STATE="${HARNESS_STATE:-/tmp/claude-1000/yumush-harness}" | ||
| 6 | 6 | [ -e "$STATE/pids" ] && { echo "harness already up: $STATE"; exit 1; } |
| 7 | 7 | mkdir -p "$STATE/server" "$STATE/xdg/xdg-desktop-portal" "$STATE/shots" |
| 8 | 8 | 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" | |
| 9 | 10 | 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) & | |
| 11 | 12 | echo "server $!" >> "$STATE/pids" |
| 12 | 13 | dbus-run-session -- "$HERE/session.sh" "$STATE" >"$STATE/session.log" 2>&1 & |
| 13 | 14 | echo "session $!" >> "$STATE/pids" |