chat sessions in project view
This commit is contained in:
@@ -6,6 +6,7 @@ export default function ProjectModal({ project, mode, onSave, onDelete, onClose
|
||||
const [name, setName] = useState(project?.name ?? '');
|
||||
const [description, setDescription] = useState(project?.description ?? '');
|
||||
const [colour, setColour] = useState(project?.colour ?? COLOURS[0]);
|
||||
const [projectOnly, setProjectOnly] = useState(project?.projectOnly === 1 ?? false);
|
||||
const inputRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -15,7 +16,7 @@ export default function ProjectModal({ project, mode, onSave, onDelete, onClose
|
||||
function handleSubmit() {
|
||||
const trimmed = name.trim();
|
||||
if (!trimmed) return;
|
||||
onSave({ name: trimmed, description: description.trim() || null, colour, icon: null });
|
||||
onSave({ name: trimmed, description: description.trim() || null, colour, icon: null, projectOnly });
|
||||
onClose();
|
||||
}
|
||||
|
||||
@@ -122,6 +123,33 @@ export default function ProjectModal({ project, mode, onSave, onDelete, onClose
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Project-Only toggle */}
|
||||
<div className="flex items-center" style={{ justifyContent: 'space-between' }}>
|
||||
<div className="flex-col" style={{ gap: '2px' }}>
|
||||
<label className="label-upper">Project Only</label>
|
||||
<span className="text-xs text-muted">Limit context to this project only</span>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setProjectOnly(i => !i)}
|
||||
style={{
|
||||
width: '40px', height: '22px', borderRadius: '11px', flexShrink: 0,
|
||||
background: projectOnly ? 'var(--accent-hover)' : 'var(--bg-elevated)',
|
||||
border: '1px solid var(--border)',
|
||||
position: 'relative', cursor: 'pointer', transition: 'background 0.2s',
|
||||
}}
|
||||
>
|
||||
<span style={{
|
||||
position: 'absolute', top: '3px',
|
||||
left: projectOnly ? '20px' : '3px',
|
||||
width: '14px', height: '14px',
|
||||
borderRadius: '50%',
|
||||
background: projectOnly ? 'white' : 'var(--text-muted)',
|
||||
transition: 'left 0.2s',
|
||||
}} />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="flex" style={{ gap: '8px', justifyContent: 'flex-end' }}>
|
||||
<button className="btn-reset text-base text-muted"
|
||||
onClick={onClose}
|
||||
|
||||
Reference in New Issue
Block a user