export function navigationFeedbackForm(form: FormTs) {
// Navigation Experience Feedback - Website UX Assessment
// Demonstrates: RatingScale (CES), EmojiRating, RadioButton, CheckboxList, MatrixQuestion, Slider
// ============================================
// HEADER
// ============================================
form.addRow(row => {
row.addTextPanel('header', {
label: 'Navigation Feedback',
computedValue: () => 'Help us understand your experience finding what you needed.',
customStyles: {
backgroundColor: '#6366f1',
color: 'white',
padding: '20px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
// ============================================
// SECTION 1: Task Context
// ============================================
const taskSection = form.addSubform('taskSection', {
title: 'What Were You Looking For?'
});
taskSection.addRow(row => {
row.addRadioButton('taskType', {
label: 'What were you trying to find or do?',
options: [
{ id: 'product', name: 'Find a specific product or service' },
{ id: 'info', name: 'Find information (pricing, specs, etc.)' },
{ id: 'support', name: 'Get help or support' },
{ id: 'contact', name: 'Find contact information' },
{ id: 'account', name: 'Access my account or settings' },
{ id: 'content', name: 'Read content (blog, articles, etc.)' },
{ id: 'compare', name: 'Compare options' },
{ id: 'other', name: 'Something else' }
],
orientation: 'vertical',
isRequired: true
});
});
taskSection.addRow(row => {
row.addRadioButton('taskOutcome', {
label: 'Did you find what you were looking for?',
options: [
{ id: 'yes-easy', name: 'Yes, easily' },
{ id: 'yes-effort', name: 'Yes, but it took effort' },
{ id: 'partial', name: 'Partially - found some of what I needed' },
{ id: 'no', name: 'No, couldn\'t find it' },
{ id: 'gave-up', name: 'Gave up looking' }
],
orientation: 'vertical',
isRequired: true
});
});
// ============================================
// SECTION 2: Navigation Effort (CES-style)
// ============================================
const effortSection = form.addSubform('effortSection', {
title: 'Navigation Effort',
isVisible: () => taskSection.radioButton('taskType')?.value() !== null
});
effortSection.addRow(row => {
row.addRatingScale('navigationEffort', {
label: 'How easy was it to navigate to what you needed?',
preset: 'ces',
lowLabel: 'Very difficult',
highLabel: 'Very easy',
alignment: 'center',
isRequired: true
});
});
effortSection.addRow(row => {
row.addEmojiRating('navigationFeeling', {
label: 'How did the navigation experience make you feel?',
preset: 'custom',
emojis: [
{ id: 'lost', emoji: '😵', label: 'Lost' },
{ id: 'confused', emoji: '😕', label: 'Confused' },
{ id: 'neutral', emoji: '😐', label: 'Neutral' },
{ id: 'confident', emoji: '🙂', label: 'Confident' },
{ id: 'effortless', emoji: '😎', label: 'Effortless' }
],
size: 'lg',
alignment: 'center'
});
});
// ============================================
// SECTION 3: Navigation Path
// ============================================
const pathSection = form.addSubform('pathSection', {
title: 'How Did You Navigate?',
isVisible: () => taskSection.radioButton('taskType')?.value() !== null
});
pathSection.addRow(row => {
row.addCheckboxList('navigationMethods', {
label: 'How did you try to find what you needed? (Select all that apply)',
options: [
{ id: 'main-menu', name: 'Main navigation menu' },
{ id: 'search', name: 'Search bar' },
{ id: 'footer', name: 'Footer links' },
{ id: 'sidebar', name: 'Sidebar navigation' },
{ id: 'breadcrumbs', name: 'Breadcrumbs' },
{ id: 'links', name: 'In-page links' },
{ id: 'back', name: 'Browser back button' },
{ id: 'random', name: 'Random clicking around' },
{ id: 'external', name: 'External search (Google)' }
],
orientation: 'vertical'
});
});
pathSection.addRow(row => {
row.addSlider('pagesVisited', {
label: 'Approximately how many pages did you visit before finding what you needed?',
min: 1,
max: 15,
step: 1,
showValue: true,
unit: 'pages',
defaultValue: 3
});
});
// ============================================
// SECTION 4: Specific Issues (If struggled)
// ============================================
const issuesSection = form.addSubform('issuesSection', {
title: 'What Made It Difficult?',
isVisible: () => {
const effort = effortSection.ratingScale('navigationEffort')?.value();
const outcome = taskSection.radioButton('taskOutcome')?.value();
return (effort !== null && effort !== undefined && effort <= 4) || outcome === 'no' || outcome === 'gave-up' || outcome === 'yes-effort';
},
customStyles: {
backgroundColor: '#fef3c7',
padding: '16px',
borderRadius: '8px',
borderLeft: '4px solid #f59e0b'
}
});
issuesSection.addRow(row => {
row.addCheckboxList('navigationIssues', {
label: 'What issues did you encounter? (Select all that apply)',
options: [
{ id: 'labels', name: 'Menu labels were confusing' },
{ id: 'deep', name: 'Content was buried too deep' },
{ id: 'unexpected', name: 'Things weren\'t where I expected' },
{ id: 'many-options', name: 'Too many menu options' },
{ id: 'few-options', name: 'Missing menu options' },
{ id: 'search-fail', name: 'Search didn\'t find what I needed' },
{ id: 'mobile', name: 'Hard to navigate on mobile' },
{ id: 'loading', name: 'Pages were slow to load' },
{ id: 'dead-ends', name: 'Hit dead ends (no back/next options)' }
],
orientation: 'vertical'
});
});
issuesSection.addSpacer();
issuesSection.addRow(row => {
row.addTextarea('issueDetails', {
label: 'Can you describe specifically what was frustrating?',
placeholder: 'Tell us where you got stuck or confused...',
rows: 3,
autoExpand: true
});
});
// ============================================
// SECTION 5: Positive Experience (If easy)
// ============================================
const positiveSection = form.addSubform('positiveSection', {
title: 'What Worked Well?',
isVisible: () => {
const effort = effortSection.ratingScale('navigationEffort')?.value();
return effort !== null && effort !== undefined && effort >= 6;
},
customStyles: {
backgroundColor: '#d1fae5',
padding: '16px',
borderRadius: '8px'
}
});
positiveSection.addRow(row => {
row.addSuggestionChips('whatWorked', {
label: 'What made navigation easy? (Select up to 3)',
suggestions: [
{ id: 'clear-menu', name: 'Clear menu labels' },
{ id: 'search', name: 'Good search' },
{ id: 'logical', name: 'Logical structure' },
{ id: 'breadcrumbs', name: 'Helpful breadcrumbs' },
{ id: 'fast', name: 'Fast loading' },
{ id: 'mobile', name: 'Works well on mobile' },
{ id: 'consistent', name: 'Consistent layout' }
],
max: 3,
alignment: 'left'
});
});
// ============================================
// SECTION 6: Navigation Elements Rating
// ============================================
const elementsSection = form.addSubform('elementsSection', {
title: 'Rate Navigation Elements',
isVisible: () => effortSection.ratingScale('navigationEffort')?.value() !== null
});
elementsSection.addRow(row => {
row.addMatrixQuestion('elementsMatrix', {
label: 'How would you rate these navigation elements?',
rows: [
{ id: 'main-nav', label: 'Main navigation menu' },
{ id: 'search', label: 'Search functionality' },
{ id: 'layout', label: 'Page layout and structure' },
{ id: 'links', label: 'Links and call-to-actions' },
{ id: 'mobile', label: 'Mobile navigation' }
],
columns: [
{ id: 'na', label: 'N/A' },
{ id: '1', label: 'Poor' },
{ id: '2', label: 'Fair' },
{ id: '3', label: 'Good' },
{ id: '4', label: 'Excellent' }
],
striped: true,
fullWidth: true
});
});
// ============================================
// SECTION 7: Improvement Suggestions
// ============================================
const suggestionsSection = form.addSubform('suggestionsSection', {
title: 'Improvement Suggestions',
isVisible: () => effortSection.ratingScale('navigationEffort')?.value() !== null
});
suggestionsSection.addRow(row => {
row.addTextarea('improvementSuggestions', {
label: 'How could we make it easier to find things on our website?',
placeholder: 'Share any suggestions for improving navigation...',
rows: 3,
autoExpand: true
});
});
suggestionsSection.addRow(row => {
row.addThumbRating('wouldReturn', {
label: 'Based on your navigation experience, would you return to this website?',
showLabels: true,
upLabel: 'Yes',
downLabel: 'Probably not',
size: 'lg',
alignment: 'center'
});
});
// ============================================
// SECTION 8: Summary
// ============================================
const summarySection = form.addSubform('summarySection', {
title: 'Navigation Feedback Summary',
isVisible: () => {
const effort = effortSection.ratingScale('navigationEffort')?.value();
return effort !== null;
}
});
summarySection.addRow(row => {
row.addTextPanel('summaryContent', {
computedValue: () => {
const taskType = taskSection.radioButton('taskType')?.value();
const outcome = taskSection.radioButton('taskOutcome')?.value();
const effort = effortSection.ratingScale('navigationEffort')?.value();
const feeling = effortSection.emojiRating('navigationFeeling')?.value();
const pages = pathSection.slider('pagesVisited')?.value();
const wouldReturn = suggestionsSection.thumbRating('wouldReturn')?.value();
const taskLabels: Record<string, string> = {
'product': 'Product/Service',
'info': 'Information',
'support': 'Help/Support',
'contact': 'Contact Info',
'account': 'Account Access',
'content': 'Content',
'compare': 'Compare Options',
'other': 'Other'
};
const outcomeLabels: Record<string, string> = {
'yes-easy': 'Found easily',
'yes-effort': 'Found with effort',
'partial': 'Partially found',
'no': 'Not found',
'gave-up': 'Gave up'
};
const feelingEmojis: Record<string, string> = {
'lost': '😵',
'confused': '😕',
'neutral': '😐',
'confident': '🙂',
'effortless': '😎'
};
let emoji = (effort ?? 0) >= 5 ? '✅' : (effort ?? 0) >= 3 ? '⚠️' : '❌';
let summary = `${emoji} Navigation Feedback\n`;
summary += `${'═'.repeat(25)}\n\n`;
if (taskType) summary += `🎯 Looking for: ${taskLabels[taskType] || taskType}\n`;
if (outcome) summary += `📍 Outcome: ${outcomeLabels[outcome] || outcome}\n`;
if (effort) summary += `💪 Effort Score: ${effort}/7\n`;
if (feeling) summary += `${feelingEmojis[feeling] || ''} Feeling: ${feeling}\n`;
if (pages) summary += `📄 Pages Visited: ${pages}\n`;
if (wouldReturn) summary += `\n🔄 Would Return: ${wouldReturn === 'up' ? 'Yes' : 'Probably not'}`;
return summary;
},
customStyles: () => {
const effort = effortSection.ratingScale('navigationEffort')?.value() ?? 0;
const baseStyles = {
padding: '16px',
borderRadius: '8px',
whiteSpace: 'pre-wrap',
fontFamily: 'monospace',
fontSize: '14px'
};
if (effort >= 5) {
return { ...baseStyles, backgroundColor: '#d1fae5', borderLeft: '4px solid #10b981' };
} else if (effort >= 3) {
return { ...baseStyles, backgroundColor: '#fef3c7', borderLeft: '4px solid #f59e0b' };
}
return { ...baseStyles, backgroundColor: '#fee2e2', borderLeft: '4px solid #ef4444' };
}
});
});
// ============================================
// FORM CONFIGURATION
// ============================================
form.configureSubmitButton({
label: 'Submit Navigation Feedback',
isVisible: () => effortSection.ratingScale('navigationEffort')?.value() !== null
});
form.configureCompletionScreen({
type: 'text',
title: 'Thank You!',
message: 'Your navigation feedback helps us create a better website experience. We review all responses to improve how people find what they need.'
});
}