Skip to content

Commit 91e858c

Browse files
committed
style(gui): format and mark live compare toggle checkable
1 parent 95f9d1d commit 91e858c

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

apps/linsync-gui/qml/Main.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4627,6 +4627,7 @@ Kirigami.ApplicationWindow {
46274627
icon.name: root.liveCompareEnabled ? "media-playback-pause" : "media-playback-start"
46284628
icon.color: root.activeText
46294629
visible: root.compareMode === "Text"
4630+
checkable: true
46304631
checked: root.liveCompareEnabled
46314632
Controls.ToolTip.text: root.liveCompareEnabled
46324633
? qsTr("Live raw compare is on")

apps/linsync-gui/src/bridge.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,12 @@ pub(crate) fn raw_compare_preview_bridge_response(
16691669
"mode": "Text",
16701670
});
16711671

1672-
http_response(200, "OK", "application/json", linsync::json_with_schema(body).into_bytes())
1672+
http_response(
1673+
200,
1674+
"OK",
1675+
"application/json",
1676+
linsync::json_with_schema(body).into_bytes(),
1677+
)
16731678
}
16741679

16751680
pub(crate) fn copy_bridge_response(query: &str, state: &Arc<Mutex<GuiBridgeState>>) -> Vec<u8> {

apps/linsync-gui/src/tests.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4776,17 +4776,22 @@ fn raw_compare_preview_does_not_mutate_session() {
47764776
assert!(resp.contains("HTTP/1.1 200"));
47774777
let body = json_response_body(&resp);
47784778
assert!(body["difference_count"].as_u64().unwrap() > 0);
4779-
assert!(body.get("session").is_none(), "preview must not include session state");
4779+
assert!(
4780+
body.get("session").is_none(),
4781+
"preview must not include session state"
4782+
);
47804783

47814784
// And the bridge state must have no tabs.
4782-
let session_resp = String::from_utf8(bridge_response(
4783-
"GET /session HTTP/1.1\r\n",
4784-
&paths,
4785-
&state,
4786-
))
4787-
.expect("utf-8 response");
4785+
let session_resp =
4786+
String::from_utf8(bridge_response("GET /session HTTP/1.1\r\n", &paths, &state))
4787+
.expect("utf-8 response");
47884788
let session_body = json_response_body(&session_resp);
4789-
assert!(session_body["session"]["tabs"].as_array().unwrap().is_empty());
4789+
assert!(
4790+
session_body["session"]["tabs"]
4791+
.as_array()
4792+
.unwrap()
4793+
.is_empty()
4794+
);
47904795
}
47914796

47924797
#[test]

0 commit comments

Comments
 (0)