Side A removes dead/unused parameters and unnecessary computation (post lookup, index resolution, card markup) from vote_compare_post_success_js, simplifying the function signature and its call site—an actual code simplification with reduced surface area. Side B only strips UI labels, toggle button, and error/form-id attributes from a form, which is cosmetic and arguably removes useful UX (error targeting, toggle collapse) without clear functional benefit.
constitution · epochs · watch · epoch 3
c_7b940fef005f (tommy-mor) vs c_19f4b8f10b98 (tommy-mor)
download prompt · raw event · cmp_9c9eaf906ff19c
council reasoning
A removes real dead work from vote_compare_post_success_js (ingest lookup, post index, card markup, and unused params), shrinking the call site and avoiding needless state reads. B mostly trims UI chrome and copy on the new-thread form (toggle, labels, RPC fields)—useful polish, but thinner lasting design impact.
Side A refactors `vote_compare_post_success_js` by removing unused parameters and the logic that rebuilt the post preview, leaving the function focused on updating the vote edge history and simplifying its call site. Side B mostly changes the new-thread form presentation (removing the toggle, labels, and altering placeholders/button text) and drops metadata fields from the JSON payloads, which is primarily UI churn with less clear lasting architectural value.
sides
A — c_7b940fef005f (tommy-mor)
message
[c3f01e01] cleanup
diff preview
diff --git a/server/src/api/ui_html.rs b/server/src/api/ui_html.rs
index f9912115d3c6ac18be66c952c3af445ab0f51cea..5aa6a86326ba3545d261322c010e02fe86ee1c57 100644
--- a/server/src/api/ui_html.rs
+++ b/server/src/api/ui_html.rs
@@ -254,17 +254,7 @@ async fn dispatch_ui_action(
};
n
};
- let js = vote_compare_post_success_js(
- state,
- &nav,
- &room,
- &thread_tag,
- &left_id,
- &right_id,
- &pid,
- post_index,
- )
- .await;
+ let js = vote_compare_post_success_js(state, &nav, &left_id, &right_id).await;
Response::builder()
.status(StatusCode::OK)
.header(header::CONTENT_TYPE, "text/javascript; charset=utf-8")
diff --git a/server/src/html/garden.rs b/server/src/html/garden.rs
index 7d309a075405483971109da2f34160409dc608f7..8a46b1e92d38f2c390f88d48750d95d11388cd73 100644
--- a/server/src/html/garden.rs
+++ b/server/src/html/garden.rs
@@ -176,34 +176,14 @@ fn vote_edge_history_markup(
pub(crate) async fn vote_compare_post_success_js(
state: &AppState,
nav: &ThreadNav,
- room_wire: &str,
- thread_tag: &str,
left: &ItemId,
right: &ItemId,
- post_id: &str,
- post_idx: Option<usize>,
) -> String {
- use crate::reducer::scope_from_room_wire;
let reduced = state.reduced.read().await;
- let scope = scope_from_room_wire(room_wire.trim());
- let Some(ing) = reduced.ingests_by_id.get(post_id).cloned() else {
- drop(reduced);
- return "console.warn('vote compare: new post not found');".to_string();
- };
- let idx = match post_idx {
- Some(i) => i,
- None => reduced
- .try_thread_post_index_chronological(&scope, thread_tag, post_id)
- .unwrap_or(0),
- };
- let viewer = None::<&str>;
- let now = now_ms();
- let card = ingest_entry_markup(nav, thread_tag, idx, &ing, viewer, now, &reduced);
let content = content_for_garden_view(&reduced, &nav.scope());
let edge_history = vote_edge_history_markup(content, left, right, nav);
drop(reduced);
let mut b = JsBuilder::new();
- b = b.morph_inner_selector("#vote-compare-preview", card);
b = b.morph_inner_selector("#vote-edge-history-region", edge_history);
b.build()
}
B — c_19f4b8f10b98 (tommy-mor)
message
[b5e9bc03] cleaner
diff preview
diff --git a/server/src/html/forum.rs b/server/src/html/forum.rs
index a173e7aea7a81c7cfab5f2f6a5549e0db560fb2b..670f5209c1e172b75156ef1b88ea382c70242062 100644
--- a/server/src/html/forum.rs
+++ b/server/src/html/forum.rs
@@ -465,41 +465,23 @@ fn new_thread_form_public(show: bool) -> Markup {
return html! {};
}
html! {
- button
- type="button"
- class="form-toggle"
- data-toggle-target="#public-new-thread-compose"
- data-open-label="new public thread"
- data-close-label="hide new public thread"
- aria-expanded="false"
- {
- "new public thread"
- }
- section class="compose" id="public-new-thread-compose" hidden {
- h3 { "new public thread" }
- p class="muted" { "Set thread tag and body. Example: start with a title line or use the CLI-shaped DSL." }
+ section class="compose" id="public-new-thread-compose" {
div id="public-new-thread-errors" {}
form id="public-new-thread-form" method="POST" action="/ui" data-check-action="/ui" data-check-rpc=(template_json_compact(&json!({
"action": "check_ingest",
"room": "public",
"thread_tag": {"$form": "thread_tag"},
"text": {"$form": "text"},
- "error_target": "public-new-thread-errors",
- "form_id": "public-new-thread-form",
})).unwrap()) {
input type="hidden" name=(UI_RPC_FIELD) value=(template_json_compact(&json!({
"action": "post_ingest",
"room": "public",
"thread_tag": {"$form": "thread_tag"},
"text": {"$form": "text"},
- "error_target": "public-new-thread-errors",
- "form_id": "public-new-thread-form",
})).unwrap());
- label for="new-thread-tag" { "thread tag" }
- input type="text" id="new-thread-tag" name="thread_tag" pattern="[a-z0-9_\\-]{1,64}" placeholder="my-topic";
- label for="new-thread-text" { "text" }
- textarea id="new-thread-text" name="text" rows="4" placeholder="#my-topic\n\nYour first post…" {}
- p { button type="submit" { "create / post" } }
+ input type="text" id="new-thread-tag" name="thread_tag" pattern="[a-z0-9_\\-]{1,64}" placeholder="thread-title-slug-here";
+ textarea id="new-thread-text" name="text" rows="4" placeholder="Hello threadgoers!! Behold my new thread!" {}
+ p { button type="submit" { "create thread / make first post" } }
}
}
}
Hardlinks — judgments / attempts / prompt
judgments
attempts
Prompt text is loaded only by the download route.