export function managerFeedbackForm(form: FormTs) {
// Manager Effectiveness Survey
// Demonstrates: MatrixQuestion, StarRating x8, RatingScale, ThumbRating, EmojiRating, RadioButton, Textarea, dynamic styling
// ============================================
// HEADER
// ============================================
form.addRow(row => {
row.addTextPanel('header', {
label: 'Manager Effectiveness Survey',
computedValue: () => 'Your confidential feedback helps develop better leaders.',
customStyles: {
backgroundColor: '#8b5cf6',
color: 'white',
padding: '24px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
form.addRow(row => {
row.addTextPanel('confidentialityNote', {
computedValue: () => 'All responses are confidential. Individual responses will never be shared with your manager. Results are only reported in aggregate with 3+ respondents.',
customStyles: {
backgroundColor: '#fef3c7',
padding: '12px 16px',
borderRadius: '8px',
fontSize: '14px',
borderLeft: '4px solid #f59e0b'
}
});
});
// ============================================
// SECTION 1: Relationship Context
// ============================================
const contextSection = form.addSubform('context', {
title: 'About Your Reporting Relationship'
});
contextSection.addRow(row => {
row.addDropdown('reportingDuration', {
label: 'How long have you reported to this manager?',
options: [
{ id: 'less-3m', name: 'Less than 3 months' },
{ id: '3-6m', name: '3-6 months' },
{ id: '6-12m', name: '6-12 months' },
{ id: '1-2y', name: '1-2 years' },
{ id: '2y-plus', name: 'More than 2 years' }
],
placeholder: 'Select duration',
isRequired: true
}, '1fr');
row.addDropdown('interactionFrequency', {
label: 'How often do you interact with your manager?',
options: [
{ id: 'daily', name: 'Daily' },
{ id: 'few-times-week', name: 'A few times per week' },
{ id: 'weekly', name: 'About once a week' },
{ id: 'biweekly', name: 'Every 1-2 weeks' },
{ id: 'monthly', name: 'Monthly or less' }
],
placeholder: 'Select frequency'
}, '1fr');
});
// ============================================
// SECTION 2: Overall Effectiveness
// ============================================
const overallSection = form.addSubform('overallEffectiveness', {
title: 'Overall Manager Effectiveness',
customStyles: () => {
const rating = overallSection.starRating('overallRating')?.value();
if (rating && rating >= 4) return { backgroundColor: '#dcfce7', padding: '16px', borderRadius: '8px' };
if (rating && rating <= 2) return { backgroundColor: '#fee2e2', padding: '16px', borderRadius: '8px' };
return { padding: '16px', borderRadius: '8px' };
}
});
overallSection.addRow(row => {
row.addStarRating('overallRating', {
label: 'Overall, how effective is your manager?',
maxStars: 5,
size: 'xl',
alignment: 'center',
showConfettiOnMax: true
});
});
overallSection.addRow(row => {
row.addEmojiRating('workRelationship', {
label: 'How would you describe your working relationship?',
preset: 'satisfaction',
size: 'lg',
alignment: 'center'
});
});
// ============================================
// SECTION 3: Communication Skills
// ============================================
const communicationSection = form.addSubform('communication', {
title: 'Communication & Clarity'
});
communicationSection.addRow(row => {
row.addStarRating('clearCommunication', {
label: 'Communicates expectations clearly',
maxStars: 5,
size: 'md',
alignment: 'left'
}, '1fr');
row.addStarRating('listeningSkills', {
label: 'Actively listens to team members',
maxStars: 5,
size: 'md',
alignment: 'left'
}, '1fr');
});
communicationSection.addRow(row => {
row.addStarRating('openness', {
label: 'Creates environment for open dialogue',
maxStars: 5,
size: 'md',
alignment: 'left'
}, '1fr');
row.addStarRating('updates', {
label: 'Keeps team informed of important changes',
maxStars: 5,
size: 'md',
alignment: 'left'
}, '1fr');
});
// ============================================
// SECTION 4: Support & Development Matrix
// ============================================
const developmentSection = form.addSubform('supportDevelopment', {
title: 'Support & Development'
});
developmentSection.addRow(row => {
row.addMatrixQuestion('developmentMatrix', {
label: 'Rate your manager on the following support and development areas:',
rows: [
{ id: 'feedback', label: 'Provides regular, constructive feedback', isRequired: true },
{ id: 'recognition', label: 'Recognizes and appreciates good work', isRequired: true },
{ id: 'growth', label: 'Supports my professional growth', isRequired: true },
{ id: 'coaching', label: 'Coaches and develops my skills' },
{ id: 'resources', label: 'Provides resources needed to succeed' },
{ id: 'career', label: 'Discusses my career aspirations' },
{ id: 'obstacles', label: 'Removes obstacles to my work' }
],
columns: [
{ id: '1', label: 'Strongly Disagree' },
{ id: '2', label: 'Disagree' },
{ id: '3', label: 'Neutral' },
{ id: '4', label: 'Agree' },
{ id: '5', label: 'Strongly Agree' }
],
striped: true,
fullWidth: true
});
});
// ============================================
// SECTION 5: Fairness & Trust
// ============================================
const fairnessSection = form.addSubform('fairnessTrust', {
title: 'Fairness & Trust'
});
fairnessSection.addRow(row => {
row.addStarRating('fairTreatment', {
label: 'Treats team members fairly and equitably',
maxStars: 5,
size: 'md',
alignment: 'left'
}, '1fr');
row.addStarRating('trustworthiness', {
label: 'Follows through on commitments',
maxStars: 5,
size: 'md',
alignment: 'left'
}, '1fr');
});
fairnessSection.addRow(row => {
row.addThumbRating('psychologicalSafety', {
label: 'I feel safe sharing concerns or mistakes with my manager',
showLabels: true,
upLabel: 'Yes, I feel safe',
downLabel: 'No, I hold back',
size: 'lg',
alignment: 'center'
});
});
// ============================================
// SECTION 6: Leadership & Direction
// ============================================
const leadershipSection = form.addSubform('leadership', {
title: 'Leadership & Direction'
});
leadershipSection.addRow(row => {
row.addStarRating('vision', {
label: 'Provides clear direction and priorities',
maxStars: 5,
size: 'md',
alignment: 'left'
}, '1fr');
row.addStarRating('decisionMaking', {
label: 'Makes good decisions',
maxStars: 5,
size: 'md',
alignment: 'left'
}, '1fr');
});
leadershipSection.addRow(row => {
row.addStarRating('accountability', {
label: 'Holds team accountable appropriately',
maxStars: 5,
size: 'md',
alignment: 'left'
}, '1fr');
row.addStarRating('empowerment', {
label: 'Empowers team to make decisions',
maxStars: 5,
size: 'md',
alignment: 'left'
}, '1fr');
});
// ============================================
// SECTION 7: Recommendation
// ============================================
const npsSection = form.addSubform('recommendation', {
title: 'Would You Recommend This Manager?',
customStyles: () => {
const category = npsSection.ratingScale('managerNps')?.npsCategory();
if (category === 'promoter') return { backgroundColor: '#d1fae5', padding: '16px', borderRadius: '8px' };
if (category === 'passive') return { backgroundColor: '#fef3c7', padding: '16px', borderRadius: '8px' };
if (category === 'detractor') return { backgroundColor: '#fee2e2', padding: '16px', borderRadius: '8px' };
return { padding: '16px', borderRadius: '8px' };
}
});
npsSection.addRow(row => {
row.addRatingScale('managerNps', {
label: 'How likely are you to recommend this manager to colleagues looking for a great boss?',
preset: 'nps',
showSegmentColors: true,
showCategoryLabel: true,
isRequired: true
});
});
// ============================================
// SECTION 8: Key Strengths
// ============================================
const strengthsSection = form.addSubform('strengths', {
title: 'Manager Strengths',
isVisible: () => npsSection.ratingScale('managerNps')?.value() !== null
});
strengthsSection.addRow(row => {
row.addCheckboxList('topStrengths', {
label: "Select your manager's top 3 strengths:",
options: [
{ id: 'communication', name: 'Clear communication' },
{ id: 'supportive', name: 'Supportive and caring' },
{ id: 'feedback', name: 'Provides good feedback' },
{ id: 'recognition', name: 'Recognizes achievements' },
{ id: 'development', name: 'Develops team members' },
{ id: 'fair', name: 'Fair and equitable' },
{ id: 'decisive', name: 'Decisive leader' },
{ id: 'empowering', name: 'Empowers the team' },
{ id: 'technical', name: 'Technical expertise' },
{ id: 'strategic', name: 'Strategic thinking' }
],
orientation: 'vertical',
max: 3
});
});
// ============================================
// SECTION 9: Development Areas
// ============================================
const developmentAreasSection = form.addSubform('developmentAreas', {
title: 'Areas for Development',
isVisible: () => npsSection.ratingScale('managerNps')?.value() !== null
});
developmentAreasSection.addRow(row => {
row.addCheckboxList('improvementAreas', {
label: 'Which areas would most benefit from development? (Select up to 3)',
options: [
{ id: 'communication', name: 'Communication clarity' },
{ id: 'listening', name: 'Active listening' },
{ id: 'feedback', name: 'Giving feedback' },
{ id: 'recognition', name: 'Recognition and appreciation' },
{ id: 'development', name: 'Team development' },
{ id: 'delegation', name: 'Delegation' },
{ id: 'decision', name: 'Decision making' },
{ id: 'conflict', name: 'Conflict resolution' },
{ id: 'time', name: 'Time for team members' },
{ id: 'vision', name: 'Setting direction' }
],
orientation: 'vertical',
max: 3
});
});
// ============================================
// SECTION 10: Qualitative Feedback
// ============================================
const feedbackSection = form.addSubform('qualitativeFeedback', {
title: 'Detailed Feedback',
isVisible: () => npsSection.ratingScale('managerNps')?.value() !== null
});
feedbackSection.addSpacer();
feedbackSection.addRow(row => {
row.addTextarea('strengthsComment', {
label: () => {
const nps = npsSection.ratingScale('managerNps')?.value();
if (nps !== null && nps !== undefined && nps >= 9) {
return 'What makes this manager exceptional?';
}
return "What does your manager do well that you'd like to see continue?";
},
placeholder: 'Share specific examples of effective leadership...',
rows: 3,
autoExpand: true
});
});
feedbackSection.addSpacer();
feedbackSection.addRow(row => {
row.addTextarea('improvementComment', {
label: () => {
const nps = npsSection.ratingScale('managerNps')?.value();
if (nps !== null && nps !== undefined && nps <= 6) {
return 'What specific changes would significantly improve your experience?';
}
return 'What could your manager do differently to be even more effective?';
},
placeholder: 'Provide constructive suggestions for growth...',
rows: 3,
autoExpand: true
});
});
// ============================================
// SECTION 11: Additional Input
// ============================================
const additionalSection = form.addSubform('additional', {
title: 'Any Other Feedback',
isVisible: () => npsSection.ratingScale('managerNps')?.value() !== null
});
additionalSection.addRow(row => {
row.addTextarea('additionalComments', {
label: 'Is there anything else you would like to share about your manager?',
placeholder: 'Any additional thoughts, context, or feedback...',
rows: 3,
autoExpand: true
});
});
// ============================================
// SECTION 12: Summary
// ============================================
const summarySection = form.addSubform('summary', {
title: 'Feedback Summary',
isVisible: () => npsSection.ratingScale('managerNps')?.value() !== null
});
summarySection.addRow(row => {
row.addTextPanel('summaryContent', {
computedValue: () => {
const overall = overallSection.starRating('overallRating')?.value();
const relationship = overallSection.emojiRating('workRelationship')?.value();
const nps = npsSection.ratingScale('managerNps')?.value();
const category = npsSection.ratingScale('managerNps')?.npsCategory();
const safety = fairnessSection.thumbRating('psychologicalSafety')?.value();
const strengths = strengthsSection.checkboxList('topStrengths')?.value() || [];
const improvements = developmentAreasSection.checkboxList('improvementAreas')?.value() || [];
if (!nps) return '';
const relationshipLabels: Record<string, string> = {
'very-bad': 'Challenging',
'bad': 'Difficult',
'neutral': 'Neutral',
'good': 'Good',
'excellent': 'Excellent'
};
let summary = `Manager Feedback Summary\n`;
summary += `${'═'.repeat(30)}\n\n`;
if (overall) {
summary += `Overall Effectiveness: ${'★'.repeat(overall)}${'☆'.repeat(5 - overall)}\n`;
}
if (relationship) {
summary += `Working Relationship: ${relationshipLabels[relationship] || relationship}\n`;
}
summary += `\nManager NPS: ${nps}/10`;
if (category) {
const label = category === 'promoter' ? ' (Strong)' :
category === 'passive' ? ' (Neutral)' : ' (Needs Attention)';
summary += label;
}
if (safety) {
summary += `\n\nPsychological Safety: ${safety === 'up' ? 'Yes' : 'No'}`;
}
if (strengths.length > 0) {
summary += `\n\nTop Strengths: ${strengths.length} identified`;
}
if (improvements.length > 0) {
summary += `\nDevelopment Areas: ${improvements.length} identified`;
}
return summary;
},
customStyles: () => {
const category = npsSection.ratingScale('managerNps')?.npsCategory();
const baseStyles = {
padding: '16px',
borderRadius: '8px',
whiteSpace: 'pre-wrap',
fontFamily: 'monospace',
fontSize: '14px'
};
if (category === 'promoter') {
return { ...baseStyles, backgroundColor: '#d1fae5', borderLeft: '4px solid #10b981' };
} else if (category === 'passive') {
return { ...baseStyles, backgroundColor: '#fef3c7', borderLeft: '4px solid #f59e0b' };
} else if (category === 'detractor') {
return { ...baseStyles, backgroundColor: '#fee2e2', borderLeft: '4px solid #ef4444' };
}
return { ...baseStyles, backgroundColor: '#f1f5f9' };
}
});
});
// ============================================
// FORM CONFIGURATION
// ============================================
form.configureSubmitButton({
label: 'Submit Confidential Feedback',
isVisible: () => npsSection.ratingScale('managerNps')?.value() !== null
});
form.configureCompletionScreen({
type: 'text',
title: 'Thank you for your confidential feedback!',
message: 'Your input is valuable for leadership development. All responses remain anonymous and will be reported only in aggregate. Your feedback makes a difference.'
});
}