Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/crates/core/src/agentic/session/session_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,23 @@ impl SessionManager {

let max_length = max_length.unwrap_or(20);

// Get current user locale for language setting
let user_language = if let Some(service) = crate::service::get_global_i18n_service().await {
service.get_current_locale().await
} else {
crate::service::LocaleId::ZhCN
};

let language_instruction = match user_language {
crate::service::LocaleId::ZhCN => "使用简体中文",
crate::service::LocaleId::EnUS => "Use English",
};

// Construct system prompt
let system_prompt = format!(
"You are a professional session title generation assistant. Based on the user's message content, generate a concise and accurate session title.\n\nRequirements:\n- Title should not exceed {} characters\n- Use English\n- Concise and accurate, reflecting the conversation topic\n- Do not add quotes or other decorative symbols\n- Return only the title text, no other content",
max_length
"You are a professional session title generation assistant. Based on the user's message content, generate a concise and accurate session title.\n\nRequirements:\n- Title should not exceed {} characters\n- {}\n- Concise and accurate, reflecting the conversation topic\n- Do not add quotes or other decorative symbols\n- Return only the title text, no other content",
max_length,
language_instruction
);

// Truncate message to save tokens (max 200 characters)
Expand Down
2 changes: 1 addition & 1 deletion src/crates/core/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub use diff::{
};
pub use filesystem::{DirectoryStats, FileSystemService, FileSystemServiceFactory};
pub use git::GitService;
pub use i18n::{I18nConfig, I18nService, LocaleId, LocaleMetadata};
pub use i18n::{get_global_i18n_service, I18nConfig, I18nService, LocaleId, LocaleMetadata};
pub use lsp::LspManager;
pub use mcp::MCPService;
pub use project_context::{ContextDocumentStatus, ProjectContextConfig, ProjectContextService};
Expand Down
127 changes: 37 additions & 90 deletions src/web-ui/src/features/onboarding/components/OnboardingWizard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
align-items: center;
justify-content: space-between;
gap: $size-gap-4;
padding: $size-gap-4 $size-gap-6;
padding: $size-gap-2 $size-gap-3;
border-top: 1px dashed var(--border-medium);
}

Expand All @@ -183,11 +183,11 @@
align-items: center;
justify-content: center;
gap: $size-gap-2;
min-height: 40px;
padding: 8px 16px;
min-width: 100px;
min-height: 32px;
padding: 6px 16px;
min-width: 80px;
border: 1px dashed var(--border-medium);
border-radius: var(--size-radius-base, 8px);
border-radius: 4px;
background: transparent;
color: var(--color-text-secondary);
font-size: $font-size-sm;
Expand Down Expand Up @@ -376,7 +376,7 @@
gap: $size-gap-2;
padding: $size-gap-3 $size-gap-6;
border: 1px dashed var(--border-medium);
border-radius: $size-radius-base;
border-radius: 4px;
background: transparent;
color: var(--color-text-secondary);
font-size: $font-size-base;
Expand Down Expand Up @@ -447,9 +447,9 @@
display: flex;
flex-direction: column;
align-items: center;
font-size: $font-size-2xl;
font-weight: $font-weight-semibold;
color: var(--color-text-primary);
font-size: $font-size-lg;
font-weight: $font-weight-medium;
color: var(--color-text-muted);
margin: $size-gap-4 0 $size-gap-6 0;
text-align: center;
line-height: 1.6;
Expand Down Expand Up @@ -852,58 +852,9 @@
flex-direction: column;
gap: $size-gap-2;

// Adapt component library Select for onboarding (class is .select, not .bitfun-select)
// Use component library default Select styles
.select {
width: 100%;

.select__label {
font-size: $font-size-sm;
font-weight: $font-weight-medium;
color: var(--color-text-primary);
margin-bottom: $size-gap-2;
}

.select__trigger {
min-height: 40px;
padding: 8px 12px;
border: 1px solid var(--border-base, rgba(255, 255, 255, 0.08));
border-radius: var(--size-radius-base, 8px);
background: var(--element-bg-subtle, rgba(255, 255, 255, 0.04));

&:hover:not(.select--disabled &) {
border-color: var(--border-medium, rgba(255, 255, 255, 0.15));
background: var(--glass-blue-subtle, rgba(96, 165, 250, 0.05));
}
}

&.select--open .select__trigger {
border-color: var(--color-accent-500, #60a5fa);
background: var(--element-bg-soft, rgba(255, 255, 255, 0.06));
box-shadow: 0 0 0 3px var(--color-accent-200, rgba(96, 165, 250, 0.15));
}

// Dropdown - tighter corners
.select__dropdown {
border-radius: var(--size-radius-base, 8px);
margin-top: 4px;
}

// Options list - tighter padding
.select__options {
padding: 4px;
}

// Option item - tighter gap and padding
.select__option {
padding: 6px 10px;
gap: 8px;
font-size: $font-size-sm;
border-radius: var(--size-radius-sm, 6px);
}

.select__option-content {
gap: 8px;
}
}
}

Expand All @@ -913,16 +864,16 @@
color: var(--color-text-primary);
}

// Inputs - match Select sizing
// Inputs - match component library Select sizing
&__input {
width: 100%;
min-height: 40px;
padding: 8px 12px;
border: 1px solid var(--border-base, rgba(255, 255, 255, 0.08));
border-radius: var(--size-radius-base, 8px);
background: var(--element-bg-subtle, rgba(255, 255, 255, 0.04));
min-height: 36px;
padding: 6px 12px;
border: 1px solid var(--border-base, rgba(255, 255, 255, 0.14));
border-radius: var(--size-radius-sm, 6px);
background: transparent;
color: var(--color-text-primary);
font-size: $font-size-sm;
font-size: var(--font-size-sm, 14px);
font-family: $font-family-sans;
box-sizing: border-box;
transition: all $motion-base $easing-standard;
Expand All @@ -931,16 +882,14 @@
color: var(--color-text-muted);
}

&:hover {
border-color: var(--border-medium, rgba(255, 255, 255, 0.15));
background: var(--glass-blue-subtle, rgba(96, 165, 250, 0.05));
&:hover:not(:disabled) {
background: var(--element-bg-subtle, rgba(255, 255, 255, 0.05));
border-color: var(--border-strong, rgba(255, 255, 255, 0.26));
}

&:focus {
outline: none;
border-color: var(--color-accent-500, #60a5fa);
background: var(--element-bg-soft, rgba(255, 255, 255, 0.06));
box-shadow: 0 0 0 3px var(--color-accent-200, rgba(96, 165, 250, 0.15));
}
}

Expand Down Expand Up @@ -1069,11 +1018,11 @@
width: 100%;
min-height: 80px;
padding: 8px 12px;
border: 1px solid var(--border-base, rgba(255, 255, 255, 0.08));
border-radius: var(--size-radius-base, 8px);
background: var(--element-bg-subtle, rgba(255, 255, 255, 0.04));
border: 1px solid var(--border-base, rgba(255, 255, 255, 0.14));
border-radius: var(--size-radius-sm, 6px);
background: transparent;
color: var(--color-text-primary);
font-size: $font-size-xs;
font-size: var(--font-size-sm, 14px);
font-family: monospace;
line-height: 1.5;
box-sizing: border-box;
Expand All @@ -1084,16 +1033,14 @@
color: var(--color-text-muted);
}

&:hover {
border-color: var(--border-medium, rgba(255, 255, 255, 0.15));
background: var(--glass-blue-subtle, rgba(96, 165, 250, 0.05));
&:hover:not(:disabled) {
background: var(--element-bg-subtle, rgba(255, 255, 255, 0.05));
border-color: var(--border-strong, rgba(255, 255, 255, 0.26));
}

&:focus {
outline: none;
border-color: var(--color-accent-500, #60a5fa);
background: var(--element-bg-soft, rgba(255, 255, 255, 0.06));
box-shadow: 0 0 0 3px var(--color-accent-200, rgba(96, 165, 250, 0.15));
}
}

Expand Down Expand Up @@ -1121,22 +1068,22 @@
align-items: center;
justify-content: center;
gap: $size-gap-2;
min-height: 40px;
padding: 8px 12px;
border: 1px dashed var(--border-medium);
border-radius: var(--size-radius-base, 8px);
min-height: 36px;
padding: 6px 12px;
border: 1px solid var(--border-base, rgba(255, 255, 255, 0.14));
border-radius: var(--size-radius-sm, 6px);
background: transparent;
color: var(--color-text-secondary);
font-size: $font-size-sm;
font-size: var(--font-size-sm, 14px);
font-weight: $font-weight-medium;
font-family: $font-family-sans;
cursor: pointer;
box-sizing: border-box;
transition: all $motion-base $easing-standard;

&:hover:not(:disabled) {
border-style: solid;
background: var(--element-bg-subtle);
background: var(--element-bg-subtle, rgba(255, 255, 255, 0.05));
border-color: var(--border-strong, rgba(255, 255, 255, 0.26));
color: var(--color-text-primary);
}

Expand Down Expand Up @@ -1333,10 +1280,10 @@
display: flex;
align-items: center;
justify-content: center;
min-height: 40px;
padding: 8px 16px;
min-height: 32px;
padding: 6px 16px;
border: 1px dashed var(--border-medium);
border-radius: var(--size-radius-base, 8px);
border-radius: 4px;
background: transparent;
color: var(--color-text-secondary);
font-size: $font-size-sm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ export const LanguageStep: React.FC<LanguageStepProps> = ({
BitFun
</h1>

{/* Subtitle - always show both languages */}
{/* Subtitle - both languages on one line with / separator */}
<div className="bitfun-onboarding-language__subtitle">
<span>选择界面语言</span>
<span>Choose Your Language</span>
<span>选择界面语言 / Choose Your Language</span>
</div>

{/* Language options */}
Expand Down
16 changes: 8 additions & 8 deletions src/web-ui/src/flow_chat/components/InlineDiffPreview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,36 +140,36 @@
background: var(--color-bg-secondary, rgba(255, 255, 255, 0.03));
user-select: none;
border-right: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.05));

&--single {
padding: 0 4px;
gap: 0;

.diff-line__num {
min-width: 24px;
padding: 0 4px;
}
}
}

&__num {
min-width: 32px;
padding: 0 6px;
text-align: right;
color: var(--color-text-muted, #666);
opacity: 0.6;
font-size: 11px;

&--original {
border-right: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
padding-right: 8px;
}

&--modified {
padding-left: 8px;
}
}

&__prefix {
display: flex;
align-items: center;
Expand Down Expand Up @@ -245,10 +245,10 @@
background: rgba(0, 0, 0, 0.03);
border-right-color: rgba(0, 0, 0, 0.08);
}

.diff-line__num {
color: #6e7781;

&--original {
border-right-color: rgba(0, 0, 0, 0.1);
}
Expand Down
4 changes: 2 additions & 2 deletions src/web-ui/src/flow_chat/components/InlineDiffPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ export const InlineDiffPreview: React.FC<InlineDiffPreviewProps> = memo(({

const origNum = line.originalLineNumber ?? '';
const modNum = line.modifiedLineNumber ?? '';

const prefix = line.type === 'added' ? '+' : line.type === 'removed' ? '-' : ' ';

return (
<div
key={`line-${index}`}
Expand Down
2 changes: 1 addition & 1 deletion src/web-ui/src/tools/editor/components/DiffEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export const DiffEditor: React.FC<DiffEditorProps> = ({

glyphMargin: false,
folding: false,
lineNumbersMinChars: 2,
lineNumbersMinChars: 4,
lineDecorationsWidth: 10,
padding: { top: 4, bottom: 4 },

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
padding: $size-gap-5;
gap: $size-gap-3;

svg {
> svg {
width: 48px;
height: 48px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,8 @@
// ==================== Dialog ====================
.bitfun-add-knowledge-dialog {
position: relative;
background: var(--color-bg-primary);
border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
border-radius: 10px;
width: 420px;
max-width: calc(100vw - 48px);
max-height: 85vh;
display: flex;
flex-direction: column;
box-shadow:
0 20px 60px rgba(0, 0, 0, 0.35),
0 0 0 1px rgba(255, 255, 255, 0.04);
animation: bitfun-dialog-enter 0.2s cubic-bezier(0.16, 1, 0.3, 1);

@keyframes bitfun-dialog-enter {
from {
opacity: 0;
transform: translateY(16px) scale(0.98);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}

// ==================== Header ====================
&__header {
Expand Down
Loading