{"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[601d3a05] fix(html): drop home toolbar + and ExpandNewThreadForm (single + flow)\n\nPublic home now SSRs #new-thread-ui-slot like room pages: collapsed compose\nfor signed-in users, login hint when logged out. Removes the extra toolbar\nthat morphed the same collapsed state and the expand_new_thread_form action.\n\nMade-with: Cursor\n\nSide A — unified diff (full patch):\ndiff --git a/server/src/api/ui_html.rs b/server/src/api/ui_html.rs\nindex e979053ff1ba8c0e2bf55add0a32b7de11cf1e56..f3ce5cb2ab2f923440a8479d0f1fb4acbba166ca 100644\n--- a/server/src/api/ui_html.rs\n+++ b/server/src/api/ui_html.rs\n@@ -139,51 +139,6 @@ async fn dispatch_ui_action(\n }\n }\n }\n- HtmlUiAction::ExpandNewThreadForm { room_wire } => {\n- let room_wire = room_wire.trim().to_string();\n- if room_wire.is_empty() {\n- return ui_js_warn(\"missing room\").into_response();\n- }\n- if room_wire == \"public\" {\n- let reduced = state.reduced.read().await;\n- let user = session.map(|s| s.username.as_str());\n- drop(reduced);\n- let markup = if user.is_some() {\n- fragment_new_thread_slot(&ThreadNav::public(), true, false)\n- } else {\n- login_to_post_hint_markup()\n- };\n- return JsBuilder::new()\n- .morph_inner_selector(\"#new-thread-ui-slot\", markup)\n- .into_response();\n- }\n- let reduced = state.reduced.read().await;\n- let user = session.map(|s| s.username.as_str());\n- if !reduced.rooms.contains(&room_wire) {\n- drop(reduced);\n- return ui_js_warn(\"room not found\").into_response();\n- }\n- if !user_can_view_room(&reduced, &room_wire, user) {\n- drop(reduced);\n- return ui_js_warn(\"forbidden\").into_response();\n- }\n- let can_post = session\n- .as_ref()\n- .map(|s| user_can_post_room(&reduced, &room_wire, &s.username))\n- .unwrap_or(false);\n- drop(reduced);\n- let Some(nav) = ThreadNav::from_room_id(&room_wire) else {\n- return ui_js_warn(\"bad room\").into_response();\n- };\n- let markup = if can_post {\n- fragment_new_thread_slot(&nav, true, false)\n- } else {\n- login_to_post_hint_markup()\n- };\n- JsBuilder::new()\n- .morph_inner_selector(\"#new-thread-ui-slot\", markup)\n- .into_response()\n- }\n HtmlUiAction::SetRoomMembersExpanded { room_wire, expanded } => {\n let room_wire = room_wire.trim().to_string();\n if room_wire.is_empty() {\ndiff --git a/server/src/html/forum/feed.rs b/server/src/html/forum/feed.rs\nindex 1b4ae7baa3ad4757b74172d7b67f3f2b33d1075d..945bdd6c48bc164e2cf91fd0996c4321b75f5abf 100644\n--- a/server/src/html/forum/feed.rs\n+++ b/server/src/html/forum/feed.rs\n@@ -14,6 +14,7 @@ use crate::timeago;\n \n use super::ingest::ingest_entry_markup;\n use super::nav::ThreadNav;\n+use super::new_thread::{fragment_new_thread_slot, login_to_post_hint_markup};\n use super::page::auth_strip;\n use super::paginator::{render_thread_paginator, PAGE_SIZE};\n use crate::html::{\n@@ -217,9 +218,6 @@ pub async fn home(\n let strip = auth_strip(&headers, &jar, &reduced_read);\n drop(reduced_read);\n \n- use crate::html::ui_action::{HtmlUiAction, UI_RPC_FIELD};\n- use crate::form_template::template_json_compact;\n-\n let page = layout(\n \"slug.social\",\n \"view-thread\",\n@@ -243,15 +241,13 @@ pub async fn home(\n }\n }\n p class=\"muted\" { \"dark = time-ordered · light = vote-ranked\" }\n- div class=\"thread-feed-toolbar\" {\n- form method=\"POST\" action=\"/ui\" {\n- input type=\"hidden\" name=(UI_RPC_FIELD) value=(template_json_compact(&HtmlUiAction::ExpandNewThreadForm {\n- room_wire: \"public\".into(),\n- }).expect(\"static json\"));\n- button type=\"submit\" class=\"section-add-btn\" { \"+\" }\n+ div id=\"new-thread-ui-slot\" {\n+ @if user.is_some() {\n+ (fragment_new_thread_slot(&nav, true, false))\n+ } @else {\n+ (login_to_post_hint_markup())\n }\n }\n- div id=\"new-thread-ui-slot\" {}\n (render_thread_feed(Some(&nav), \"thread-feed\", &public_rows, now))\n (cli_panel(&[\"npx slugsocial public forum list\"]))\n },\ndiff --git a/server/src/html/ui_action.rs b/server/src/html/ui_action.rs\nindex 5031ebfeb928f28e471f23210b8c644654adb7c7..da0c9b3541e8e4988a78768cddef22324755c3f2 100644\n--- a/server/src/html/ui_action.rs\n+++ b/server/src/html/ui_action.rs\n@@ -38,11 +38,6 @@ pub enum HtmlUiAction {\n RedactPost {\n post_id: String,\n },\n- /// Morph `#new-thread-ui-slot` inner to the collapsed compose toggle (or login hint).\n- /// Use `room_wire: \"public\"` for the public forum home; otherwise a private room id (`short/slug`).\n- ExpandNewThreadForm {\n- room_wire: String,\n- },\n /// Morph `#room-members-section` — members list open or collapsed (server-rendered).\n SetRoomMembersExpanded {\n room_wire: String,\n@@ -131,26 +126,6 @@ mod tests {\n );\n }\n \n- #[test]\n- fn expand_new_thread_form_public() {\n- let template = serde_json::json!({\n- \"action\": \"expand_new_thread_form\",\n- \"room_wire\": \"public\",\n- });\n- let mut form = HashMap::new();\n- form.insert(\n- UI_RPC_FIELD.to_string(),\n- serde_json::to_string(&template).unwrap(),\n- );\n- let a = parse_html_ui_from_form(&form).unwrap();\n- assert_eq!(\n- a,\n- HtmlUiAction::ExpandNewThreadForm {\n- room_wire: \"public\".into(),\n- }\n- );\n- }\n-\n #[test]\n fn expand_post_full_round_trip() {\n let template = serde_json::json!({\n\n\nSide B — contributor: tommy-mor\nSide B — 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 B — 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","role":"user"}],"model":"~anthropic/claude-sonnet-latest"}