The change compiles successfully. Here's a summary of what I did: (#1930)
## Summary Increased the workspace name length from 35 to 60 characters in `vibe-kanban/crates/db/src/models/workspace.rs`: 1. Added a constant at the top of the file: ```rust const WORKSPACE_NAME_MAX_LEN: usize = 60; ``` 2. Updated both occurrences where the hardcoded `35` was used: - Line 586 in `find_all_with_status` - Line 673 in `find_by_id_with_status` Both now use `WORKSPACE_NAME_MAX_LEN` instead of the hardcoded value, making future adjustments easier.
This commit is contained in:
committed by
GitHub
parent
9f1c4b9416
commit
7ba1867a8f
@@ -5,6 +5,9 @@ use thiserror::Error;
|
||||
use ts_rs::TS;
|
||||
use uuid::Uuid;
|
||||
|
||||
/// Maximum length for auto-generated workspace names (derived from first user prompt)
|
||||
const WORKSPACE_NAME_MAX_LEN: usize = 60;
|
||||
|
||||
use super::{
|
||||
project::Project,
|
||||
task::Task,
|
||||
@@ -580,7 +583,7 @@ impl Workspace {
|
||||
if ws.workspace.name.is_none()
|
||||
&& let Some(prompt) = Self::get_first_user_message(pool, ws.workspace.id).await?
|
||||
{
|
||||
let name = Self::truncate_to_name(&prompt, 35);
|
||||
let name = Self::truncate_to_name(&prompt, WORKSPACE_NAME_MAX_LEN);
|
||||
Self::update(pool, ws.workspace.id, None, None, Some(&name)).await?;
|
||||
ws.workspace.name = Some(name);
|
||||
}
|
||||
@@ -667,7 +670,7 @@ impl Workspace {
|
||||
if ws.workspace.name.is_none()
|
||||
&& let Some(prompt) = Self::get_first_user_message(pool, ws.workspace.id).await?
|
||||
{
|
||||
let name = Self::truncate_to_name(&prompt, 35);
|
||||
let name = Self::truncate_to_name(&prompt, WORKSPACE_NAME_MAX_LEN);
|
||||
Self::update(pool, ws.workspace.id, None, None, Some(&name)).await?;
|
||||
ws.workspace.name = Some(name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user