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:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user