Commit A makes small but user-visible changes: it removes redundant UI elements from the vote page and fixes the vote slider gradient logic so the highlighted side matches the selected winner. Although labeled as 'nits', it changes application behavior and presentation. Commit B is dominated by workspace-wide rustfmt reformatting with a few tooling improvements (pinning rustfmt/clippy, adding VS Code settings, and a minor CSS cleanup). Those changes improve developer experience and consistency but have much less impact on the project's functionality.
constitution · epochs · watch · epoch 3
c_8fdd9b86c77f (tommy-mor) vs c_9e1ff4fc0186 (tommy-mor)
download prompt · raw event · cmp_5ecf02004dcc6c
council reasoning
Commit A is a small cleanup: removing a few UI elements and tweaking CSS gradients. Commit B, while largely non-functional, applies workspace-wide formatting, fixes lint/tooling issues, pins toolchain components, adds editor configuration, and cleans up duplicated CSS. These changes significantly improve maintainability, consistency, and developer experience across the entire project, making it far more impactful overall.
Commit B performs a workspace-wide rustfmt run affecting many source files, improves code consistency, pins rustfmt and clippy in rust-toolchain.toml to stabilize tooling, adds VS Code configuration for correct rust-analyzer toolchain usage, and fixes/cleans related code and CSS. This impacts a large portion of the codebase and developer workflow. Commit A is a small UI/CSS tweak and removal of some markup/functions labeled as 'nits', with limited scope. Therefore B contributes substantially more overall.
sides
A — c_8fdd9b86c77f (tommy-mor)
message
[2a5db1ce] nits
diff preview
diff --git a/server/src/html/vote.rs b/server/src/html/vote.rs
index d32b206e2fb043466c0ce333d7d215dc1a3e91c9..483c7ff8cd35266744957cf0087f2b5f76f1a237 100644
--- a/server/src/html/vote.rs
+++ b/server/src/html/vote.rs
@@ -105,7 +105,6 @@ fn vote_edge_history(tree: &GlobalTree, group: &GroupState, left: &ItemId, right
} @else {
h3 class="vote-edge-history-title" {
"votes on this pair"
- span class="vote-edge-history-axis muted" { " · " (legend_left) " : " (legend_right) }
}
ul class="vote-edge-history" {
@for v in &votes {
@@ -126,13 +125,6 @@ fn vote_edge_history(tree: &GlobalTree, group: &GroupState, left: &ItemId, right
}
}
-fn vote_back_nav(parent: &ItemId) -> Markup {
- html! {
- div class="vote-compare-nav" {
- a class="vote-compare-back muted" href=(item_href(parent)) { "← back to " (display_label(parent)) }
- }
- }
-}
fn vote_hud_form(
parent: &ItemId,
@@ -286,10 +278,6 @@ pub async fn vote_page(
section class="vote-compare-shell" {
h1 { "compare" }
(breadcrumb_path(&parent))
- p class="muted vote-compare-scope" {
- "ranking children of "
- a href=(item_href(&parent)) { (child_title(&tree, &parent)) }
- }
div class="vote-compare-pair" {
(vote_compare_item_card(&tree, &left, "vote-compare-left"))
span class="vote-compare-vs" { "vs" }
diff --git a/server/static/sorter.css b/server/static/sorter.css
index 7b485dd232f60363f4eff0c5a362addf191d05c6..5da967e8bfddc2bc34662fced841860f63f1ef36 100644
--- a/server/static/sorter.css
+++ b/server/static/sorter.css
@@ -480,10 +480,10 @@ h1 {
border: 2px solid var(--border);
background: linear-gradient(
to right,
- var(--accent) 0%,
- var(--accent) var(--vote-slider-pct, 50%),
+ var(--vote-track-muted) 0%,
var(--vote-track-muted) var(--vote-slider-pct, 50%),
- var(--vote-track-muted) 100%
+ var(--accent) var(--vote-slider-pct, 50%),
+ var(--accent) 100%
);
}
@@ -493,10 +493,10 @@ h1 {
border: 2px solid var(--border);
background: linear-gradient(
to right,
- var(--vote-track-muted) 0%,
- var(--vote-track-muted) var(--vote-slider-pct, 50%),
+ var(--accent) 0%,
var(--accent) var(--vote-slider-pct, 50%),
- var(--accent) 100%
+ var(--vote-track-muted) var(--vote-slider-pct, 50%),
+ var(--vote-track-muted) 100%
);
}
@@ -522,20 +522,20 @@ h1 {
.vote-hud-slider input[type="range"][data-winner="left"]::-moz-range-track {
background: linear-gradient(
to right,
- var(--accent) 0%,
- var(--accent) var(--vote-slider-pct, 50%),
+ var(--vote-track-muted) 0%,
var(--vote-track-muted) var(--vote-slider-pct, 50%),
- var(--vote-track-muted) 100%
+ var(--accent) var(--vote-slider-pct, 50%),
+ var(--accent) 100%
);
}
.vote-hud-slider input[type="range"][data-winner="right"]::-moz-range-track {
background: linear-gradient(
to right,
- var(--vote-track-muted) 0%,
- var(--vote-track-muted) var(--vote-slider-pct, 50%),
+ var(--accent) 0%,
var(--accent) var(--vote-slider-pct, 50%),
- var(--accent) 100%
+ var(--vote-track-muted) var(--vote-slider-pct, 50%),
+ var(--vote-track-muted) 100%
);
}
B — c_9e1ff4fc0186 (tommy-mor)
message
[2a94401b] Run rustfmt workspace-wide and fix lint tooling. Pin rustfmt and clippy in rust-toolchain.toml after a broken component install, merge a duplicate vote-slider CSS rule, and add VS Code settings so rust-analyzer uses the project toolchain. Co-authored-by: Cursor <cursoragent@cursor.com>
diff preview
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000000000000000000000000000000000000..98ebd754a6d5a972550506c69c5a10c10e3210b6
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,8 @@
+{
+ "rust-analyzer.rustc.source": "discover",
+ "rust-analyzer.check.command": "check",
+ "rust-analyzer.procMacro.enable": true,
+ "rust-analyzer.cargo.extraEnv": {
+ "RUSTUP_TOOLCHAIN": "1.88.0"
+ }
+}
diff --git a/durable/examples/combined_example.rs b/durable/examples/combined_example.rs
index 626a6e1cf7e3c9c26f9f2edc58950d9bc31ec67e..6e9cb3210714d74c9a2cc0ed4f87e1b8d84788da 100644
--- a/durable/examples/combined_example.rs
+++ b/durable/examples/combined_example.rs
@@ -1,5 +1,5 @@
use durable::{Db, DurableMap, DurableVec};
-use serde::{Serialize, Deserialize};
+use serde::{Deserialize, Serialize};
use std::time::{SystemTime, UNIX_EPOCH};
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -28,36 +28,48 @@ fn get_timestamp() -> u64 {
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open or create a database
let db = Db::open("chat_db")?;
-
+
// Create our collections
let mut users = DurableMap::<String, User>::new(&db, "users")?;
let mut messages = DurableVec::<Message>::new(&db, "messages")?;
let mut user_message_indices = DurableMap::<String, Vec<usize>>::new(&db, "user_messages")?;
-
+
// Create some users
- users.insert("alice".to_string(), User {
- username: "alice".to_string(),
- display_name: "Alice Smith".to_string(),
- message_count: 0,
- })?;
-
- users.insert("bob".to_string(), User {
- username: "bob".to_string(),
- display_name: "Bob Johnson".to_string(),
- message_count: 0,
- })?;
-
- users.insert("charlie".to_string(), User {
- username: "charlie".to_string(),
- display_name: "Charlie Brown".to_string(),
- message_count: 0,
- })?;
-
+ users.insert(
+ "alice".to_string(),
+ User {
+ username: "alice".to_string(),
+ display_name: "Alice Smith".to_string(),
+ message_count: 0,
+ },
+ )?;
+
+ users.insert(
+ "bob".to_string(),
+ User {
+ username: "bob".to_string(),
+ display_name: "Bob Johnson".to_string(),
+ message_count: 0,
+ },
+ )?;
+
+ users.insert(
+ "charlie".to_string(),
+ User {
+ username: "charlie".to_string(),
+ display_name: "Charlie Brown".to_string(),
+ message_count: 0,
+ },
+ )?;
+
// Helper to send a message
- let send_message = |from: &str, to: &str, content: &str,
+ let send_message = |from: &str,
+ to: &str,
+ content: &str,
messages: &mut DurableVec<Message>,
users: &mut DurableMap<String, User>,
- indices: &mut DurableMap<String, Vec<usize>>| -> Result<(), Box<dyn std::error::Error>> {
+ indices: &mut DurableMap<String, Vec<usize>>|
+ -> Result<(), Box<dyn std::error::Error>> {
// Create message
let msg_id = messages.len()? as u64;
let message = Message {
@@ -67,61 +79,93 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
content: content.to_string(),
timestamp: get_timestamp(),
};
-
+
// Store message
messages.push(message)?;
let msg_index = messages.len()? - 1;
-
+
// Update sender's message count
if let Some(mut sender) = users.get(&from.to_string())? {
sender.message_count += 1;
users.insert(from.to_string(), sender)?;
}
-
+
// Track message indices for recipient
let mut recipient_indices = indices.get(&to.to_string())?.unwrap_or_default();
recipient_indices.push(msg_index);
indices.insert(to.to_string(), recipient_indices)?;
-
+
Ok(())
};
-
+
// Send some messages
println!("💬 Chat Application Demo\n");
println!("Sending messages...");
-
- send_message("alice", "bob", "Hey Bob, how's the Durable library coming along?",
- &mut messages, &mut users, &mut user_message_indices)?;
-
- send_message("bob", "alice", "It's going great! We have DurableVec and DurableMap working!",
- &mut messages, &mut users, &mut user_message_indices)?;
-
- send_message("charlie", "alice", "That sounds awesome! Can I help with testing?",
- &mut messages, &mut users, &mut user_message_indices)?;
-
- send_message("alice", "charlie", "Absolutely! The more testing the better!",
- &mut messages, &mut users, &mut user_message_indices)?;
-
- send_message("bob", "charlie", "Check out the examples directory for usage patterns",
- &mut messages, &mut users, &mut user_message_indices)?;
-
+
+ send_message(
+ "alice",
+ "bob",
+ "Hey Bob, how's the Durable library coming along?",
+ &mut messages,
+ &mut users,
+ &mut user_message_indices,
+ )?;
+
+ send_message(
+ "bob",
+ "alice",
+ "It's going great! We have DurableVec and DurableMap working!",
+ &mut messages,
+ &mut users,
+ &mut user_message_indices,
+ )?;
+
+ send_message(
+ "charlie",
+ "alice",
+ "That sounds awesome! Can I help with testing?",
+ &mut messages,
+ &mut users,
+ &mut user_message_indices,
+ )?;
+
+ send_message(
+ "alice",
+ "charlie",
+ "Absolutely! The more testing the better!",
+ &mut messages,
+ &mut users,
+ &mut user_message_indices,
+ )?;
+
+ send_message(
+ "bob",
+ "charlie",
+ "Check out the examples directory for usage patterns",
+ &mut messages,
+ &mut users,
+ &mut user_message_indices,
+ )?;
+
// Display all users and their message counts
println!("\n👥 Users:");
let mut all_users = users.to_vec()?;
all_users.sort_by_key(|(username, _)| username.clone());
-
+
for (username, user) in all_users {
- println!(" {} ({}) - {} messages sent",
- user.display_name, username, user.message_count);
+ println!(
+ " {} ({}) - {} messages sent",
+ user.display_name, username, user.message_count
+ );
}
-
+
// Display all messages
println!("\n📨 All messages:");
for (i, msg) in messages.iter()?.enumerate() {
let msg = msg?;
println!(" [{}] {} → {}: {}", i, msg.from, msg.to, msg.content);
}
-
+
// Show inbox for each user
println!("\n📥 User inboxes:");
for item in users.iter() {
@@ -135,26 +179,26 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
}
}
-
+
// Statistics
println!("\n📊 Statistics:");
println!(" Total users: {}", users.len()?);
println!(" Total messages: {}", messages.len()?);
-
+
// Demonstrate persistence
println!("\n💾 Data has been persisted to disk!");
println!(" Database location: ./chat_db");
-
+
// Clean up
drop(messages);
drop(users);
drop(user_message_indices);
drop(db);
-
+
// Remove the database for this example
std::fs::remove_dir_all("chat_db").ok();
-
+
println!("\n✅ Example completed!");
-
+
Ok(())
-}
\ No newline at end of file
+}
diff --git a/durable/examples/map_example.rs b/durable/examples/map_example.rs
index 08b8f2c8826caf53c4c20b422a540c92f6624029..1d9c4a14b0f4cfe39ade84ebb1f1a14033e8ff1b 100644
--- a/durable/examples/map_example.rs
+++ b/durable/examples/map_example.rs
@@ -1,5 +1,5 @@
use durable::{Db, DurableMap};
-use serde::{Serialize, Deserialize};
+use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
struct UserProfile {
@@ -11,10 +11,10 @@ struct UserProfile {
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open or create a database
let db = Db::open("example_db")?;
-
+
// Create a persistent map of user profiles
let mut users = DurableMap::<String, UserProfile>::new(&db, "users")?;
-
+
// Insert some users
// Using put() when we don't need the old value - more efficient!
users.put(
@@ -25,7 +25,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
score: 1500,
},
)?;
-
+
users.put(
"bob".to_string(),
UserProfile {
@@ -34,7 +34,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
score: 1200,
},
)?;
-
+
// Using insert() when we might need the old value
let old_charlie = users.insert(
"charlie".to_string(),
@@ -44,21 +44,24 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
score: 1800,
},
)?;
-
+
if old_charlie.is_some() {
println!("Replaced existing charlie entry");
}
-
+
println!("Total users: {}", users.len()?);
-
+
// Look up a specific user
if let Some(alice) = users.get(&"alice".to_string())? {
println!("\nAlice's profile: {:?}", alice);
}
-
+
// Check if a user exists
- println!("\nDoes 'david' exist? {}", users.contains_key(&"david".to_string())?);
-
+ println!(
+ "\nDoes 'david' exist? {}",
+ users.contains_key(&"david".to_string())?
+ );
+
// Update a user's score
if let Some(mut bob) = users.get(&"bob".to_string())? {
bob.score += 100;
@@ -66,34 +69,40 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
users.put("bob".to_string(), bob)?;
println!("Updated Bob's score!");
}
-
+
// Iterate over all users
println!("\nAll users (sorted by username):");
let mut all_users = users.to_vec()?;
all_users.sort_by_key(|(username, _)| username.clone());
-
+
for (username, profile) in all_users {
- println!(" {} ({}) - Score: {}", username, profile.email, profile.score);
+ println!(
+ " {} ({}) - Score: {}",
+ username, profile.email, profile.score
+ );
}
-
+
// Get just the usernames
let mut usernames = users.keys_vec()?;
usernames.sort();
println!("\nAll usernames: {:?}", usernames);
-
+
// Find the highest scoring user
let profiles = users.values_vec()?;
if let Some(top_user) = profiles.iter().max_by_key(|p| p.score) {
- println!("\nTop scorer: {} with {} points", top_user.name, top_user.score);
+ println!(
+ "\nTop scorer: {} with {} points",
+ top_user.name, top_user.score
+ );
}
-
+
// Remove a user
if let Some(removed) = users.remove(&"charlie".to_string())? {
println!("\nRemoved user: {}", removed.name);
println!("Users remaining: {}", users.len()?);
}
-
+
println!("\nData has been persisted to disk.");
-
+
Ok(())
-}
\ No newline at end of file
+}
diff --git a/durable/examples/nested_example.rs b/durable/examples/nested_example.rs
index 3b880f2c8b8ad2633d4b5fcf2016652216c9de8e..f16090cf6fb854ac7a1b00acfd31fbd12c25dbce 100644
--- a/durable/examples/nested_example.rs
+++ b/durable/examples/nested_example.rs
@@ -3,27 +3,31 @@ use durable::{Db, DurableMap, DurableVec};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open a database
let db = Db::open("nested_example_db")?;
-
+
// Create a map where each user has a list of posts
- let user_posts: DurableMap<String, DurableVec<String>> = DurableMap::new_nested(&db, "user_posts");
-
+ let user_posts: DurableMap<String, DurableVec<String>> =
+ DurableMap::new
… preview truncated; 96,900 characters omittedHardlinks — judgments / attempts / prompt
judgments
attempts
Prompt text is loaded only by the download route.