💡 User Story
As a user, I want to be prevented from entering flowchart names longer than 50 characters, so that I can maintain clean and consistent naming across my flowcharts.
📖 Description
Currently, there is no character limit enforced for flowchart names in the application. This can lead to excessively long names that may cause UI issues or make it difficult to identify flowcharts in the list view. We need to implement a 50-character limit for flowchart names on both the frontend and backend.
The implementation should:
- Add client-side validation to prevent users from entering more than 50 characters in the name input field
- Add server-side validation to ensure that flowchart names cannot exceed 50 characters
- Provide appropriate error messages to users when they attempt to exceed this limit
This feature will improve the user experience by maintaining consistent naming conventions and preventing potential UI issues caused by extremely long names.
✅ Acceptance Criteria
📌 Technical Details
Frontend Implementation:
- Modify the
handleNameChange function in Client/src/components/flowchart/flowchartSidePanel/flowchartList/SavedFlowchartList.tsx to limit input to 50 characters
- Add validation before submitting the form to ensure the name is within the limit
Backend Implementation:
- Add validation in
server/src/db/models/flowchart/flowchartCollection.ts to check the name length before saving
- Update the error handling in
server/src/routes/flowchart.ts to return appropriate error messages for name length violations
- Ensure consistent validation across all flowchart-related endpoints (optional)
Code Changes Required:
-
In Client/src/components/flowchart/flowchartSidePanel/flowchartList/SavedFlowchartList.tsx:
// Handle name change
const handleNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const newName = e.target.value;
// Limit to 50 characters
if (newName.length <= 50) {
setName(newName);
}
};
-
In server/src/db/models/flowchart/flowchartCollection.ts:
// Add validation before updating
if (name.length > 50) {
throw new Error("Flowchart name cannot exceed 50 characters");
}
🖼️ UI/UX Mockups (If applicable)
The UI should include a character counter below the name input field, showing something like "X/50 characters" to provide visual feedback to users.
📎 Related Issues or Dependencies
🚀 Priority & Story Points
- Priority: Medium
- Story Points: 3
File Paths
The files that might need to be modified are:
Client/src/components/flowchart/flowchartSidePanel/flowchartList/SavedFlowchartList.tsx
Client/src/components/flowchart/flowchartSidePanel/flowchartList/FlowchartLogOptions.tsx
server/src/db/models/flowchart/flowchartCollection.ts
server/src/routes/flowchart.ts
💡 User Story
As a user, I want to be prevented from entering flowchart names longer than 50 characters, so that I can maintain clean and consistent naming across my flowcharts.
📖 Description
Currently, there is no character limit enforced for flowchart names in the application. This can lead to excessively long names that may cause UI issues or make it difficult to identify flowcharts in the list view. We need to implement a 50-character limit for flowchart names on both the frontend and backend.
The implementation should:
This feature will improve the user experience by maintaining consistent naming conventions and preventing potential UI issues caused by extremely long names.
✅ Acceptance Criteria
📌 Technical Details
Frontend Implementation:
handleNameChangefunction inClient/src/components/flowchart/flowchartSidePanel/flowchartList/SavedFlowchartList.tsxto limit input to 50 charactersBackend Implementation:
server/src/db/models/flowchart/flowchartCollection.tsto check the name length before savingserver/src/routes/flowchart.tsto return appropriate error messages for name length violationsCode Changes Required:
In
Client/src/components/flowchart/flowchartSidePanel/flowchartList/SavedFlowchartList.tsx:In
server/src/db/models/flowchart/flowchartCollection.ts:🖼️ UI/UX Mockups (If applicable)
The UI should include a character counter below the name input field, showing something like "X/50 characters" to provide visual feedback to users.
📎 Related Issues or Dependencies
🚀 Priority & Story Points
File Paths
The files that might need to be modified are:
Client/src/components/flowchart/flowchartSidePanel/flowchartList/SavedFlowchartList.tsxClient/src/components/flowchart/flowchartSidePanel/flowchartList/FlowchartLogOptions.tsxserver/src/db/models/flowchart/flowchartCollection.tsserver/src/routes/flowchart.ts