{"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[8dab9b80] nice\n\nSide A — unified diff (full patch):\ndiff --git a/server/src/fetch/html.rs b/server/src/fetch/html.rs\nindex 3e0309ff1c2ac1b17923922d2340ba6710e0f9d1..dadf050515f0473943dad97df5d318032c8cb385 100644\n--- a/server/src/fetch/html.rs\n+++ b/server/src/fetch/html.rs\n@@ -10,13 +10,18 @@ use crate::{\n ui_action::UI_RPC_FIELD,\n };\n \n-fn entity_panel(node: &NodeState) -> Markup {\n+/// CSS selector for Idiomorph / SSE updates of one entity block.\n+pub fn entity_section_selector(item: &ItemId) -> String {\n+ format!(r#\"[data-entity-section=\"{}\"]\"#, item.as_str())\n+}\n+\n+pub fn entity_panel(node: &NodeState) -> Markup {\n if let Some(markup) = crate::render::reddit::entity_markup(node) {\n return markup;\n }\n html! {\n @if let Some(data) = &node.data {\n- div id=\"entity-panel\" class=\"entity-card\" {\n+ div class=\"entity-card\" {\n h2 { (data.title) }\n @if let Some(author) = &data.author {\n p class=\"muted small\" { \"by \" (author) }\n@@ -76,11 +81,11 @@ pub fn fetch_entity_panel(item: &ItemId, has_data: bool, fetching: bool) -> Mark\n }\n }\n \n-/// Entity card + fetch control (target `#entity-section` for Idiomorph / SSE).\n+/// Entity card + fetch control (morph target [`entity_section_selector`]).\n pub fn entity_section(item: &ItemId, node: &NodeState, fetching: bool) -> Markup {\n let has_data = node.data.is_some();\n html! {\n- section id=\"entity-section\" class=\"demo-panel\" {\n+ section class=\"entity-section demo-panel\" data-entity-section=(item.as_str()) {\n (entity_panel(node))\n (fetch_entity_panel(item, has_data, fetching))\n }\ndiff --git a/server/src/fetch/mod.rs b/server/src/fetch/mod.rs\nindex 35f968c21c69ca557bab7951413e3cfbbccfebfd..f5759a34a1afe4069805441cefde6474a6403550 100644\n--- a/server/src/fetch/mod.rs\n+++ b/server/src/fetch/mod.rs\n@@ -77,8 +77,9 @@ pub fn fetch_entity_stream(\n let tree = state.tree.read().await;\n let empty = NodeState::default();\n let node = tree.get(&id).unwrap_or(&empty);\n+ let sel = html::entity_section_selector(&id);\n JsBuilder::new()\n- .morph_selector(\"#entity-section\", html::entity_section(&id, node, true))\n+ .morph_selector(&sel, html::entity_section(&id, node, true))\n .build()\n };\n yield Ok(js_event(fetching_js));\n@@ -100,12 +101,13 @@ pub fn fetch_entity_stream(\n FetchJobResult::Imported(_)\n | FetchJobResult::NotFound\n | FetchJobResult::SkippedCached\n- | FetchJobResult::SkippedDuplicate => {\n+ | FetchJobResult::SkippedDuplicate => {\n let tree = state.tree.read().await;\n let empty = NodeState::default();\n let node = tree.get(&id).unwrap_or(&empty);\n+ let sel = html::entity_section_selector(&id);\n let mut b = JsBuilder::new()\n- .morph_selector(\"#entity-section\", html::entity_section(&id, node, false));\n+ .morph_selector(&sel, html::entity_section(&id, node, false));\n if kind == FetchKind::Children {\n b = b.morph_selector(\"#ranking-panel\", ranking_panel(&id, node, &tree));\n }\n@@ -115,8 +117,9 @@ pub fn fetch_entity_stream(\n let tree = state.tree.read().await;\n let empty = NodeState::default();\n let node = tree.get(&id).unwrap_or(&empty);\n+ let sel = html::entity_section_selector(&id);\n let js = JsBuilder::new()\n- .morph_selector(\"#entity-section\", html::entity_section(&id, node, false))\n+ .morph_selector(&sel, html::entity_section(&id, node, false))\n .raw(&error_js(&format!(\"Reddit rate limit — retry in {reset_secs}s.\")))\n .build();\n yield Ok(js_event(js));\n@@ -125,8 +128,9 @@ pub fn fetch_entity_stream(\n let tree = state.tree.read().await;\n let empty = NodeState::default();\n let node = tree.get(&id).unwrap_or(&empty);\n+ let sel = html::entity_section_selector(&id);\n let js = JsBuilder::new()\n- .morph_selector(\"#entity-section\", html::entity_section(&id, node, false))\n+ .morph_selector(&sel, html::entity_section(&id, node, false))\n .raw(&error_js(&format!(\"Fetch failed: {msg}\")))\n .build();\n yield Ok(js_event(js));\ndiff --git a/server/src/html/vote.rs b/server/src/html/vote.rs\nindex 89ed621ad861214e147add2062224fc4137ff8ad..48752f4d78d4762d1badc44e8df008bf5a45bab4 100644\n--- a/server/src/html/vote.rs\n+++ b/server/src/html/vote.rs\n@@ -8,6 +8,7 @@ use maud::{html, Markup};\n use serde::Deserialize;\n \n use crate::{\n+ fetch::html::entity_section,\n form_template::template_json_compact,\n html::JsBuilder,\n pair::{children_of, resolve_pair, suggest_next_pair_in_pool},\n@@ -169,37 +170,13 @@ pub(crate) fn vote_recorded_morph(\n }\n \n fn vote_compare_item_card(tree: &GlobalTree, item: &ItemId, side_class: &str) -> Markup {\n- let href = item_href(item);\n- let title = child_title(tree, item);\n+ let node = tree.get(item).cloned().unwrap_or_else(|| NodeState {\n+ id: item.clone(),\n+ ..Default::default()\n+ });\n html! {\n div class=(format!(\"vote-compare-side {side_class}\")) {\n- a class=(format!(\"vote-compare-item {side_class}\")) href=(href) {\n- @if let Some(row) = crate::render::reddit::child_row_markup(tree, item, &href) {\n- (row)\n- } @else {\n- strong { (title) }\n- }\n- }\n- @if let Some(node) = tree.get(item) {\n- @if crate::render::reddit::is_reddit_post(item) {\n- @if let Some(data) = &node.data {\n- @if let Some(src) = data.image_url.as_ref().or(data.thumb_url.as_ref()) {\n- figure class=\"vote-compare-figure\" {\n- img class=\"vote-compare-image\" src=(src) alt=\"\" loading=\"lazy\";\n- }\n- }\n- @if let Some(author) = &data.author {\n- p class=\"muted small\" { \"by \" (author) }\n- }\n- }\n- } @else if let Some(data) = &node.data {\n- @if let Some(body) = &data.body_html {\n- div class=\"vote-compare-item-body\" {\n- (maud::PreEscaped(body))\n- }\n- }\n- }\n- }\n+ (entity_section(item, &node, false))\n }\n }\n }\n@@ -270,9 +247,6 @@ pub async fn vote_page(\n (vote_compare_item_card(&tree, &right, \"vote-compare-right\"))\n }\n (vote_back_nav(&parent))\n- div id=\"vote-edge-history-region\" {\n- (edge_history)\n- }\n form id=\"vote-compare-form\" method=\"POST\" action=\"/ui\" {\n input type=\"hidden\" name=(UI_RPC_FIELD) value=(rpc_json);\n input type=\"hidden\" name=\"ratio_left\" id=\"vote-ratio-left\" value=\"50\";\n@@ -285,6 +259,9 @@ pub async fn vote_page(\n }\n (vote_compare_actions(&parent, next_pair.as_ref()))\n }\n+ div id=\"vote-edge-history-region\" {\n+ (edge_history)\n+ }\n }\n };\n \ndiff --git a/server/src/render/reddit.rs b/server/src/render/reddit.rs\nindex 4a18de93cf57d8395ded3caa373a708f39b3f43f..c4f98fc760c32ce1b41a91bd41e97908bd198937 100644\n--- a/server/src/render/reddit.rs\n+++ b/server/src/render/reddit.rs\n@@ -11,7 +11,7 @@ pub fn is_reddit_post(id: &ItemId) -> bool {\n id.as_str().starts_with(\"reddit.com/\") && id.as_str().contains(\"/comments/\")\n }\n \n-/// Post detail card (`#entity-panel`).\n+/// Post detail card (inside [`crate::fetch::html::entity_panel`]).\n pub fn entity_markup(node: &NodeState) -> Option {\n if !is_reddit_post(&node.id) {\n return None;\n@@ -41,7 +41,7 @@ pub fn child_row_markup(tree: &GlobalTree, id: &ItemId, href: &str) -> Option Markup {\n let image = data.image_url.as_ref().or(data.thumb_url.as_ref());\n html! {\n- div id=\"entity-panel\" class=\"entity-card reddit-post\" {\n+ div class=\"entity-card reddit-post\" {\n h2 { (data.title) }\n @if let Some(author) = &data.author {\n p class=\"muted small\" { \"by \" (author) }\ndiff --git a/server/static/sorter.css b/server/static/sorter.css\nindex b95718ce463b200a5667d3014dac2119836a0bef..9379c5f41dedbd41fd8951099a118de1da2a62f4 100644\n--- a/server/static/sorter.css\n+++ b/server/static/sorter.css\n@@ -254,38 +254,11 @@ h1 {\n }\n \n .vote-compare-side {\n- background: var(--panel);\n- border: 1px solid var(--border);\n- border-radius: 8px;\n- padding: 1rem;\n min-height: 120px;\n }\n \n-.vote-compare-item {\n- color: var(--accent);\n- text-decoration: none;\n- display: block;\n-}\n-\n-.vote-compare-item:hover {\n- text-decoration: underline;\n-}\n-\n-.vote-compare-figure {\n- margin: 0.75rem 0 0;\n-}\n-\n-.vote-compare-image {\n- display: block;\n- max-width: 100%;\n- height: auto;\n- border-radius: 6px;\n- border: 1px solid var(--border);\n-}\n-\n-.vote-compare-item-body {\n- margin-top: 0.75rem;\n- font-size: 0.9rem;\n+.vote-compare-side .entity-section {\n+ margin: 0;\n }\n \n .vote-compare-nav {\n\n\nSide B — contributor: tommy-mor\nSide B — commit message:\n[65bce99f] sibling groups #130\n\nSide B — unified diff (full patch):\ndiff --git a/server/src/html/garden.rs b/server/src/html/garden.rs\nindex 82c1b4b4f36ea13a906035a1789ba893222b3695..e3c56d124ab7b0fa08c7f9ae736103e6b7cf5862 100644\n--- a/server/src/html/garden.rs\n+++ b/server/src/html/garden.rs\n@@ -837,7 +837,8 @@ struct SiblingNavGroup {\n links: Vec,\n }\n \n-/// Siblings under the same parent, grouped like child rankings (components then isolates).\n+/// Siblings under the same parent: one group per ranking component (ordered list), then one\n+/// group per isolated unranked sibling (each shows rank `1`, separated like components).\n #[derive(Debug, Clone)]\n struct SiblingNavBar {\n groups: Vec,\n@@ -890,15 +891,12 @@ fn build_sibling_nav(\n groups.push(SiblingNavGroup { links });\n }\n }\n- if !rankings.unranked_items.is_empty() {\n- let links: Vec = rankings\n- .unranked_items\n- .iter()\n- .map(|u| SiblingNavLink {\n+ for u in &rankings.unranked_items {\n+ groups.push(SiblingNavGroup {\n+ links: vec![SiblingNavLink {\n path: u.clone().normalized_storage().to_storage_string(),\n- })\n- .collect();\n- groups.push(SiblingNavGroup { links });\n+ }],\n+ });\n }\n let sibling_total: usize = groups.iter().map(|g| g.links.len()).sum();\n if sibling_total <= 1 {\n@@ -1541,6 +1539,29 @@ mod tests {\n assert_eq!(nav.groups[1].links.len(), 1);\n }\n \n+ #[test]\n+ fn sibling_nav_splits_each_unranked_into_its_own_group() {\n+ let mut reduced = ReducerState::default();\n+ apply_ingest(\n+ &mut reduced,\n+ 1,\n+ \"@00000000-0000-0000-0000-000000000000:test:local/test\\n\\\n+ ~/topic {topic body}\\n\\\n+ ~/topic/a {alpha}\\n\\\n+ ~/topic/b {beta}\\n\\\n+ ~/topic/c {gamma}\\n\\\n+ ~/topic/d {delta}\\n\\\n+ {a beats b}\\n ~/topic/a 2:1 ~/topic/b\\n\",\n+ );\n+\n+ let model = build_item_page_view_model(&reduced, &ScopeId::Public, \"~/topic/a\");\n+ let nav = model.sibling_nav.expect(\"expected sibling nav\");\n+ assert_eq!(nav.groups.len(), 3);\n+ assert_eq!(nav.groups[0].links.len(), 2);\n+ assert_eq!(nav.groups[1].links.len(), 1);\n+ assert_eq!(nav.groups[2].links.len(), 1);\n+ }\n+\n #[test]\n fn item_page_model_builds_ranked_child_components() {\n let mut reduced = ReducerState::default();\n","role":"user"}],"model":"~anthropic/claude-sonnet-latest"}