// ForwardQueue — capture items for next week before they slip.
// ADHD-friendly open-loop parking lot tied to the weekly block rhythm.
// On Sunday: shows "Promote to this week" button on each item.
// Items can be tagged to a block so MC knows where they'll land.
const FQ_BLOCKS = [
{ id: 'ceo', label: 'Mon · CEO Hour', accent: '#6366f1' },
{ id: 'delivery', label: 'Tue–Thu · Delivery', accent: '#059669' },
{ id: 'outreach', label: 'Fri · Outreach + Sales', accent: '#d97706' },
{ id: 'other', label: 'General / No block', accent: '#94a3b8' },
];
function blockMeta(id) {
return FQ_BLOCKS.find((b) => b.id === id) || FQ_BLOCKS[3];
}
function ForwardQueue() {
const { state, addNextWeekItem, deleteNextWeekItem, promoteNextWeekItem, updateNextWeekBlock } = useStore();
const [draft, setDraft] = React.useState('');
const [draftBlock, setDraftBlock] = React.useState('other');
const [adding, setAdding] = React.useState(false);
const inputRef = React.useRef(null);
const isSunday = new Date().getDay() === 0;
const items = state.nextWeek || [];
const submit = (e) => {
e?.preventDefault();
const t = draft.trim();
if (!t) { setAdding(false); return; }
addNextWeekItem(t, draftBlock);
setDraft('');
setDraftBlock('other');
setAdding(false);
};
const startAdding = () => {
setAdding(true);
setTimeout(() => inputRef.current?.focus(), 50);
};
const cardStyle = {
background: 'var(--surface)',
border: '1px solid var(--border)',
borderRadius: 12,
padding: '16px 20px',
display: 'flex',
flexDirection: 'column',
gap: 12,
};
const headStyle = {
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
gap: 8,
};
const titleStyle = {
fontFamily: 'var(--font-display)',
fontWeight: 700,
fontSize: 15,
color: 'var(--fg)',
margin: 0,
};
const subStyle = {
fontFamily: 'var(--font-mono)',
fontSize: 11,
color: 'var(--fg-muted)',
marginTop: 2,
};
const addBtnStyle = {
display: 'flex',
alignItems: 'center',
gap: 6,
padding: '5px 12px',
borderRadius: 8,
border: '1px solid var(--border)',
background: 'transparent',
color: 'var(--fg-muted)',
fontFamily: 'var(--font-mono)',
fontSize: 12,
cursor: 'pointer',
flexShrink: 0,
};
const emptyStyle = {
textAlign: 'center',
padding: '18px 0',
color: 'var(--fg-muted)',
fontFamily: 'var(--font-mono)',
fontSize: 12,
lineHeight: 1.7,
};
return (
{/* Header */}
Next week
{isSunday
? '📋 Sunday planning — promote items to this week'
: 'Park open loops here — no decision needed yet'}
{/* Inline capture form */}
{adding && (
)}
{/* Item list */}
{items.length === 0 && !adding ? (
Nothing parked yet.
Capture anything your brain wants to hold on to.
) : (
{items.map((item) => {
const bm = blockMeta(item.block || 'other');
return (
deleteNextWeekItem(item.id)}
onPromote={() => promoteNextWeekItem(item.id)}
onBlockChange={(block) => updateNextWeekBlock(item.id, block)}
/>
);
})}
)}
{/* Sunday summary hint */}
{isSunday && items.length > 0 && (
🗓 Review each item — promote what fits this week. Leave the rest parked.
)}
);
}
function FQItem({ item, bm, isSunday, onDelete, onPromote, onBlockChange }) {
const [blockOpen, setBlockOpen] = React.useState(false);
const rowStyle = {
display: 'flex',
alignItems: 'flex-start',
gap: 10,
padding: '9px 12px',
borderRadius: 10,
background: 'var(--bg-elev)',
border: '1px solid var(--border)',
position: 'relative',
};
const chipStyle = {
flexShrink: 0,
padding: '2px 8px',
borderRadius: 20,
fontFamily: 'var(--font-mono)',
fontSize: 10,
fontWeight: 700,
background: bm.accent + '22',
color: bm.accent,
cursor: 'pointer',
border: 'none',
whiteSpace: 'nowrap',
marginTop: 1,
};
const textStyle = {
flex: 1,
fontFamily: 'var(--font-display)',
fontWeight: 600,
fontSize: 13,
color: 'var(--fg)',
lineHeight: 1.5,
};
const actStyle = {
display: 'flex',
alignItems: 'center',
gap: 4,
flexShrink: 0,
};
const iconBtnStyle = (danger) => ({
background: 'transparent',
border: 'none',
cursor: 'pointer',
color: danger ? 'var(--red, #e05)' : 'var(--fg-muted)',
padding: '2px 4px',
borderRadius: 6,
fontSize: 12,
opacity: 0.7,
});
return (
{/* Block tag chip */}
{blockOpen && (
setBlockOpen(false)}>
{FQ_BLOCKS.map((b) => (
))}
)}
{/* Text */}
{item.text}
{/* Actions */}
{isSunday && (
)}
);
}
Object.assign(window, { ForwardQueue });