{"messages":[{"content":"You are a constitutional council ranking individual git commits for ownership allocation.\n\nCompare these two commits. Decide which contributed more lasting value to the project.\n\nJudge substance, not spectacle:\n- Prefer correct, lasting design and real bugfixes over churn, formatting, renames, or generated noise.\n- Prefer clarity and necessity over sheer line count. A small precise change can beat a large diffuse one.\n- Do not favor a side merely because its patch is longer or noisier.\n- Weight what the change does for the project, not the contributor's name.\n\nReturn ONLY a JSON object: {\"winner\": \"A\" or \"B\", \"ratio\": \"N:M\", \"explanation\": \"...\"}\nThe explanation must cite concrete differences in the patches (1-3 sentences).\n\nSide A — contributor: tommy-mor\nSide A — commit message:\n[798c764d] feat(html): grouped cli_panel with hover-to-copy and JS-safe asserts\n\nSingle bordered panel for multiple commands; rows copy on click without a\nseparate copy control. Assert CLI strings contain no chars that would break\nsingle-quoted onclick JS.\n\nMade-with: Cursor\n\nSide A — unified diff (full patch):\ndiff --git a/server/src/html/forum.rs b/server/src/html/forum.rs\nindex f6e45b05bb92126966e304619f80ef1d45be7a4b..075860914a6ce18bb0dfa73dc5651ef1a6318b67 100644\n--- a/server/src/html/forum.rs\n+++ b/server/src/html/forum.rs\n@@ -718,7 +718,7 @@ pub async fn home(\n }\n div id=\"public-new-thread-ui-slot\" {}\n (render_thread_feed(Some(&nav), \"thread-feed\", &public_rows, now))\n- (cli_panel(\"npx slugsocial public forum list\"))\n+ (cli_panel(&[\"npx slugsocial public forum list\"]))\n },\n None,\n theme_from_jar(&jar),\n@@ -868,7 +868,7 @@ async fn thread_view_inner(\n div id=\"thread-live-region\" {\n (compose_form(&nav, &tag, show_compose))\n }\n- (cli_panel(&cli))\n+ (cli_panel(std::slice::from_ref(&cli)))\n },\n None,\n theme_from_jar(&jar),\n@@ -984,9 +984,7 @@ pub async fn room_page(\n (new_thread_form_for_room(&nav, true, false))\n }\n }\n- (cli_panel(&forum_cli))\n- (cli_panel(&garden_cli))\n- (cli_panel(&audit_cli))\n+ (cli_panel(&[forum_cli, garden_cli, audit_cli]))\n },\n None,\n theme_from_jar(&jar),\n@@ -1409,7 +1407,7 @@ pub async fn user_profile_page(\n }\n }\n }\n- (cli_panel(&format!(\"npx slugsocial public forum list\")))\n+ (cli_panel(&[format!(\"npx slugsocial public forum list\")]))\n },\n None,\n theme_from_jar(&jar),\ndiff --git a/server/src/html/garden.rs b/server/src/html/garden.rs\nindex 9b4789a79c3e293cbfc5f033a0eac8650320d94d..c8ce7de450f7d14e04020511e7eb7323bd487deb 100644\n--- a/server/src/html/garden.rs\n+++ b/server/src/html/garden.rs\n@@ -139,7 +139,7 @@ pub async fn garden_index(\n }\n }\n }\n- (cli_panel(\"npx slugsocial garden tree\"))\n+ (cli_panel(&[\"npx slugsocial garden tree\"]))\n },\n None,\n theme_from_jar(&jar),\n@@ -542,7 +542,7 @@ async fn render_scope_view(\n ScopeId::Public => format!(\"npx slugsocial public garden body {}\", path.as_str().trim_start_matches(\"https://slug.social/~/\")),\n ScopeId::Room(room_id) => format!(\"npx slugsocial private {room_id} garden body {}\", path.as_str().trim_start_matches(\"https://slug.social/~/\")),\n };\n- (cli_panel(&cli))\n+ (cli_panel(std::slice::from_ref(&cli)))\n },\n None,\n theme_from_jar(&jar),\ndiff --git a/server/src/html/mod.rs b/server/src/html/mod.rs\nindex e7f5bfb7a4b2dee2adf96447224c58d641092124..6617781a2e8e86c2e2693788ea7cd0eb0e3659a2 100644\n--- a/server/src/html/mod.rs\n+++ b/server/src/html/mod.rs\n@@ -599,18 +599,38 @@ pub(super) fn render_linkified_with_embeds_in_scope(raw: &str, garden_prefix: &s\n }\n }\n \n-/// Small CLI hint panel showing how to look up this page from the terminal.\n-pub(super) fn cli_panel(cmd: &str) -> Markup {\n+/// CLI strings are embedded in a single-quoted JS literal; they must never need escaping.\n+fn assert_cli_panel_cmd_js_single_quote_safe(s: &str) {\n+ assert!(\n+ !s.contains('\\\\')\n+ && !s.contains('\\'')\n+ && !s.contains('\\n')\n+ && !s.contains('\\r'),\n+ \"cli_panel cmd must not contain `\\\\`, `'`, or newlines (got {s:?})\"\n+ );\n+}\n+\n+/// Small CLI hint panel: one border and title; each line is hover-highlighted and copies on click.\n+pub(super) fn cli_panel>(cmds: &[I]) -> Markup {\n+ if cmds.is_empty() {\n+ return html! {};\n+ }\n+ for cmd in cmds {\n+ assert_cli_panel_cmd_js_single_quote_safe(cmd.as_ref());\n+ }\n html! {\n div class=\"cli-panel\" {\n span class=\"cli-panel-label muted\" { \"cli\" }\n- code class=\"cli-panel-cmd\" { (cmd) }\n- button\n- class=\"cli-panel-copy\"\n- title=\"Copy to clipboard\"\n- onclick=(format!(r#\"navigator.clipboard.writeText('{}'); this.textContent='✓'; setTimeout(() => this.textContent='copy', 2000);\"#, cmd.replace(\"'\", \"\\\\'\")))\n- {\n- \"copy\"\n+ div class=\"cli-panel-cmds\" {\n+ @for cmd in cmds {\n+ @let s = cmd.as_ref();\n+ button type=\"button\" class=\"cli-panel-row\" title=\"Copy command\" onclick=(format!(\n+ r#\"navigator.clipboard.writeText('{}');\"#,\n+ s\n+ )) {\n+ code class=\"cli-panel-cmd\" { (s) }\n+ }\n+ }\n }\n }\n }\ndiff --git a/server/src/html/search.rs b/server/src/html/search.rs\nindex 28ceaa53c3fcac6777311535e95fb771b19438f5..43e6ebf36cf0fe72c96f0f9d850bea51ac094c43 100644\n--- a/server/src/html/search.rs\n+++ b/server/src/html/search.rs\n@@ -418,7 +418,7 @@ pub async fn search_page(\n value=(query) autocomplete=\"off\" autofocus;\n }\n (render_search_results(&results, &query))\n- (cli_panel(\"npx slugsocial search \"))\n+ (cli_panel(&[\"npx slugsocial search \"]))\n },\n None,\n theme_from_jar(&jar),\ndiff --git a/server/static/theme_default.css b/server/static/theme_default.css\nindex e024a5c8b74139ae8be37b2a1bd17e4c3abe9324..764b66c8208e91e6138b83c534387cf43c85b8b5 100644\n--- a/server/static/theme_default.css\n+++ b/server/static/theme_default.css\n@@ -610,7 +610,7 @@ code {\n CLI PANEL — how to view this page from the terminal\n ---------------------------------------------------------------- */\n div.cli-panel {\n- align-items: baseline;\n+ align-items: flex-start;\n background: var(--g1);\n border: var(--bv) solid;\n border-color: var(--lo) var(--hi) var(--hi) var(--lo); /* inset */\n@@ -621,11 +621,34 @@ div.cli-panel {\n width: fit-content;\n max-width: 100%;\n }\n+.cli-panel-cmds {\n+ display: flex;\n+ flex-direction: column;\n+ gap: 4px;\n+ flex: 1;\n+ min-width: 0;\n+}\n+button.cli-panel-row {\n+ background: transparent;\n+ border: none;\n+ color: inherit;\n+ cursor: pointer;\n+ display: block;\n+ font: inherit;\n+ margin: 0;\n+ padding: 2px 4px;\n+ text-align: left;\n+ width: 100%;\n+}\n+button.cli-panel-row:hover {\n+ background: var(--g3);\n+}\n .cli-panel-label {\n font-size: 11px;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n flex-shrink: 0;\n+ padding-top: 2px;\n }\n .cli-panel-cmd {\n background: none;\ndiff --git a/server/static/theme_retro_craft.css b/server/static/theme_retro_craft.css\nindex 00714575bfa533d1d9c66653b9089642e2b0a6ca..f89ecbc3a18eb9b2b27d1f7764330f6bd6987552 100644\n--- a/server/static/theme_retro_craft.css\n+++ b/server/static/theme_retro_craft.css\n@@ -306,19 +306,41 @@ a.post-nav-btn:hover {\n }\n \n div.cli-panel {\n- align-items: baseline;\n+ align-items: flex-start;\n border: 1px dashed var(--line);\n display: flex;\n- flex-wrap: wrap;\n gap: 0.5rem;\n margin: 0.65rem 0;\n padding: 0.45rem 0.65rem;\n }\n+.cli-panel-cmds {\n+ display: flex;\n+ flex-direction: column;\n+ gap: 0.25rem;\n+ flex: 1;\n+ min-width: 0;\n+}\n+button.cli-panel-row {\n+ background: transparent;\n+ border: none;\n+ color: inherit;\n+ cursor: pointer;\n+ display: block;\n+ font: inherit;\n+ margin: 0;\n+ padding: 0.1rem 0.2rem;\n+ text-align: left;\n+ width: 100%;\n+}\n+button.cli-panel-row:hover {\n+ background: color-mix(in srgb, var(--accent) 14%, transparent);\n+}\n .cli-panel-label {\n color: var(--ink-dim);\n font-size: 0.72rem;\n letter-spacing: 0.12em;\n text-transform: uppercase;\n+ padding-top: 0.12rem;\n }\n .cli-panel-cmd {\n color: var(--accent);\n\n\nSide B — contributor: tommy-mor\nSide B — commit message:\n[047b82bd] Remove redundant zero-ratio guard from reducer.\n\nZeros are already rejected at the DSL parser and browser handler;\nthe guard in apply_vote was dead code. The negative clamping stays\nsince add_edge_weight already skips weight-0 edges correctly.\n\nCo-Authored-By: Claude Sonnet 4.6 \n\nSide B — unified diff (full patch):\ndiff --git a/server/src/reducer.rs b/server/src/reducer.rs\nindex 0e36979abe0f051493038ff7e652efc7f7a0ac80..efbf7f67ff24c7a2989102fe62879b2794a27c5f 100644\n--- a/server/src/reducer.rs\n+++ b/server/src/reducer.rs\n@@ -112,11 +112,6 @@ impl GroupState {\n if vote.ratio_right < 0 {\n vote.ratio_right = 0;\n }\n- if vote.ratio_left == 0 || vote.ratio_right == 0 {\n- // Zero on either side produces no valid edge; drop before registering items or pair.\n- return;\n- }\n-\n let a_idx = self.ensure_item(&vote.a);\n let b_idx = self.ensure_item(&vote.b);\n \ndiff --git a/server/tests/basic.rs b/server/tests/basic.rs\nindex 08159f4a7f0850fd165817a4a1af4f31ced2ad76..1748769ccf7196b2d81cf556d5368c7e723f6a4e 100644\n--- a/server/tests/basic.rs\n+++ b/server/tests/basic.rs\n@@ -533,7 +533,7 @@ fn dsl_parse_rejects_zero_zero_vote_ratio() {\n #[test]\n fn reducer_negative_ratio_clamped_to_zero() {\n let _state = ReducerState::default();\n- // GroupState::apply_vote clamps negatives to 0; when either side is 0 the vote is dropped.\n+ // apply_vote clamps negatives to 0; add_edge_weight skips zero-weight edges.\n let mut group = GroupState::new();\n group.apply_vote(slugsocial_server::reducer::VoteData {\n ts: 1,\n@@ -546,10 +546,9 @@ fn reducer_negative_ratio_clamped_to_zero() {\n delegate: Some(\"00000000-0000-0000-0000-000000000000:test:local/test\".to_string()),\n thread_tag: \"t\".to_string(),\n });\n- // Nothing registered: zero-clamped vote is dropped before ensure_item.\n- assert!(group.idx_to_item.is_empty());\n+ // Items and pair are registered; edges are absent because weight 0 is skipped.\n+ assert_eq!(group.idx_to_item.len(), 2);\n assert!(group.edges.is_empty());\n- assert!(group.voted_pairs.is_empty());\n }\n \n \n","role":"user"}],"model":"~anthropic/claude-sonnet-latest"}