feat(client): redesign native UI, themes, settings and avatars
Separate conversation drafts and voice view state, add native settings and restricted CSS themes, implement validated avatar cropping, and refresh dependencies with documented desktop compatibility backports.
This commit is contained in:
parent
44d284a568
commit
8e5ab56611
276 changed files with 53546 additions and 3399 deletions
106
patches/desktop-smoke/src/lib.rs
Normal file
106
patches/desktop-smoke/src/lib.rs
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
//! Real private-D-Bus checks for the maintained zbus 6 compatibility migration.
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use atspi_common::{ObjectRef, State, events::object::StateChangedEvent};
|
||||
use atspi_proxies::bus::{BusProxy, StatusProxy};
|
||||
use std::time::Duration;
|
||||
|
||||
struct AccessibilityBus;
|
||||
|
||||
#[zbus::interface(name = "org.a11y.Bus")]
|
||||
impl AccessibilityBus {
|
||||
fn get_address(&self) -> String {
|
||||
std::env::var("DBUS_SESSION_BUS_ADDRESS").unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
struct AccessibilityStatus {
|
||||
enabled: bool,
|
||||
}
|
||||
|
||||
#[zbus::interface(name = "org.a11y.Status")]
|
||||
impl AccessibilityStatus {
|
||||
#[zbus(property)]
|
||||
fn is_enabled(&self) -> bool {
|
||||
self.enabled
|
||||
}
|
||||
#[zbus(property)]
|
||||
fn screen_reader_enabled(&self) -> bool {
|
||||
self.enabled
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn real_bus_and_event_roundtrip_without_manual_executor_ticks() {
|
||||
assert!(
|
||||
std::env::var_os("DBUS_SESSION_BUS_ADDRESS").is_some(),
|
||||
"run with dbus-run-session -- cargo test --manifest-path patches/desktop-smoke/Cargo.toml"
|
||||
);
|
||||
// Mirrors Slint/AccessKit's non-Tokio path. zbus 6 drives the bus connection
|
||||
// on its maintained default runtime; callers need no executor().tick().
|
||||
futures_lite::future::block_on(async {
|
||||
let server = zbus::connection::Builder::session()
|
||||
.name("org.a11y.Bus")
|
||||
.serve_at("/org/a11y/bus", AccessibilityBus)
|
||||
.serve_at("/org/a11y/bus", AccessibilityStatus { enabled: true })
|
||||
.method_timeout(Duration::from_secs(2))
|
||||
.build()
|
||||
.await
|
||||
.unwrap();
|
||||
let client = zbus::connection::Builder::session()
|
||||
.method_timeout(Duration::from_secs(2))
|
||||
.build()
|
||||
.await
|
||||
.unwrap();
|
||||
let bus = BusProxy::new(&client).await.unwrap();
|
||||
assert_eq!(
|
||||
bus.get_address().await.unwrap(),
|
||||
std::env::var("DBUS_SESSION_BUS_ADDRESS").unwrap()
|
||||
);
|
||||
let status = StatusProxy::new(&client).await.unwrap();
|
||||
assert!(status.is_enabled().await.unwrap());
|
||||
assert!(status.screen_reader_enabled().await.unwrap());
|
||||
|
||||
// In zbus 6, Some returns the rejected duplicate and None means added.
|
||||
let duplicate = server
|
||||
.object_server()
|
||||
.at("/org/a11y/bus", AccessibilityStatus { enabled: false })
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(duplicate.is_some());
|
||||
assert!(status.is_enabled().await.unwrap());
|
||||
assert!(
|
||||
server
|
||||
.object_server()
|
||||
.at("/org/a11y/second", AccessibilityStatus { enabled: false })
|
||||
.await
|
||||
.unwrap()
|
||||
.is_none()
|
||||
);
|
||||
|
||||
let event = StateChangedEvent {
|
||||
item: ObjectRef::new_owned(
|
||||
client.unique_name().unwrap().clone(),
|
||||
zbus::ObjectPath::from_static_str_unchecked("/org/a11y/test"),
|
||||
),
|
||||
state: State::Focused,
|
||||
enabled: true,
|
||||
};
|
||||
let message = zbus::Message::try_from(event.clone()).unwrap();
|
||||
assert_eq!(StateChangedEvent::try_from(&message).unwrap(), event);
|
||||
|
||||
// Setter errors remain deferred, not ignored by the compatibility port.
|
||||
assert!(
|
||||
zbus::proxy::Builder::<zbus::Proxy<'_>>::new(&client)
|
||||
.destination("org.a11y.Bus")
|
||||
.path("invalid object path")
|
||||
.interface("org.a11y.Status")
|
||||
.build()
|
||||
.await
|
||||
.is_err()
|
||||
);
|
||||
client.close().await.unwrap();
|
||||
server.close().await.unwrap();
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue