feat: add toggle for showing draft starters on new sessions

Persists draft starter visibility across desktop and web settings
Adds a new OpenChamber visual setting with localization and search support
Hides the draft starter chips when the setting is off
This commit is contained in:
Bohdan Triapitsyn
2026-07-24 23:07:39 +03:00
parent 9ea1a2a728
commit d265a38365
20 changed files with 84 additions and 9 deletions
@@ -32,6 +32,7 @@ import { useI18n } from '@/lib/i18n';
import { useThemeSystem } from '@/contexts/useThemeSystem';
import { useDeviceInfo } from '@/lib/device';
import { cn } from '@/lib/utils';
import { useUIStore } from '@/stores/useUIStore';
import {
useDraftStarters,
type ResolvedStarter,
@@ -254,7 +255,7 @@ const AddStarterPicker: React.FC<{
* Reorder is constrained to within a chip's own group; cross-group hovers are
* ignored.
*/
export const DraftPresetChips: React.FC<DraftPresetChipsProps> = ({ onSubmit, className }) => {
const DraftPresetChipsContent: React.FC<DraftPresetChipsProps> = ({ onSubmit, className }) => {
const { global, project, pinnable, ensureLoaded, addStarter, removeStarter, reorder } = useDraftStarters();
const { isMobile } = useDeviceInfo();
const [isDragging, setIsDragging] = React.useState(false);
@@ -331,3 +332,8 @@ export const DraftPresetChips: React.FC<DraftPresetChipsProps> = ({ onSubmit, cl
</DndContext>
);
};
export const DraftPresetChips: React.FC<DraftPresetChipsProps> = (props) => {
const visible = useUIStore((state) => state.draftStartersVisible);
return visible ? <DraftPresetChipsContent {...props} /> : null;
};