Skip to content

fix: validate quick-add title length and surface field errors#9416

Open
pranav-afk wants to merge 1 commit into
makeplane:previewfrom
pranav-afk:fix/9329-quick-add-title-max-length
Open

fix: validate quick-add title length and surface field errors#9416
pranav-afk wants to merge 1 commit into
makeplane:previewfrom
pranav-afk:fix/9329-quick-add-title-max-length

Conversation

@pranav-afk

@pranav-afk pranav-afk commented Jul 13, 2026

Copy link
Copy Markdown

Description

Aligns inline (quick-add) work item creation with the modal path when the title is longer than 255 characters.

Previously, list/kanban/gantt/calendar/spreadsheet quick-add only required a title. Submitting 256+ characters hit the API with a 400 ({ name: [...] }), and the toast fell back to a generic “Some error occurred. Please try again.” because the issue service throws response.data (field errors), not an Error with message. The modal already used maxLength: 255 with title_should_be_less_than_255_characters.

Changes:
• Add maxLength: 255 validation on quick-add title inputs across list, kanban, gantt, calendar, and spreadsheet layouts
• Show the validation message under the quick-add form when the title is too long
• Improve toast error extraction so API field errors (e.g. name: ["…"]) are shown instead of a generic message
• On failed quick-add, roll back the optimistic temporary issue so a failed create does not stay in the list

Type of Change
• [x] Bug fix (non-breaking change which fixes an issue)
• [ ] Feature (non-breaking change which adds functionality)
• [ ] Improvement (change that would cause existing functionality to not work as expected)
• [ ] Code refactoring
• [ ] Performance improvements
• [ ] Documentation update

Screenshots and Media (if applicable)

Test Scenarios
• Open Work Items list view → inline + New work item
• Paste a title longer than 255 characters → press Enter
• Expect: no API call; clear “Title should be less than 255 characters” (or equivalent i18n) under the field
• Expect: not the generic error toast
• Submit a title of exactly 255 characters → work item creates successfully
• Repeat on board / spreadsheet / gantt / calendar quick-add if available
• Compare with the sidebar/modal create form: same max-length behavior
• Force a server-side field error (if possible): toast should show the field message, not only “Some error occurred”
• On a failed create, confirm the temporary optimistic row is removed from the list

References
Fixes #9329

Summary by CodeRabbit

  • Bug Fixes
    • Added a 255-character limit to issue titles in all quick-add forms, with localized validation messages.
    • Improved quick-add error handling with clearer inline feedback and more reliable error messages.
    • Quick-add failures now properly roll back temporary issues, preventing stale entries after an unsuccessful creation.

Inline work item creation showed a generic toast when the title exceeded
255 characters, while the modal path already validated with a clear
message. Add maxLength validation across quick-add layouts, extract API
field errors in the toast, and roll back optimistic temp issues on failure.

Fixes makeplane#9329
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8c000999-e385-4b5b-af19-a8fb2bbc2128

📥 Commits

Reviewing files that changed from the base of the PR and between dc9d80b and d877166.

📒 Files selected for processing (7)
  • apps/web/core/components/issues/issue-layouts/quick-add/form/calendar.tsx
  • apps/web/core/components/issues/issue-layouts/quick-add/form/gantt.tsx
  • apps/web/core/components/issues/issue-layouts/quick-add/form/kanban.tsx
  • apps/web/core/components/issues/issue-layouts/quick-add/form/list.tsx
  • apps/web/core/components/issues/issue-layouts/quick-add/form/spreadsheet.tsx
  • apps/web/core/components/issues/issue-layouts/quick-add/root.tsx
  • apps/web/core/store/issue/helpers/base-issues.store.ts

📝 Walkthrough

Walkthrough

Quick-add issue forms now enforce a localized 255-character title limit. Failed optimistic creation rolls back temporary issue state, while the quick-add root extracts structured errors and displays title validation messages inline.

Changes

Quick-add error flow

Layer / File(s) Summary
Title length validation
apps/web/core/components/issues/issue-layouts/quick-add/form/*.tsx
Calendar, Gantt, Kanban, list, and spreadsheet forms enforce a localized 255-character maximum for issue titles.
Optimistic creation rollback
apps/web/core/store/issue/helpers/base-issues.store.ts
Failed issue creation removes the temporary issue from grouped and primary store state before rethrowing the error.
Structured error presentation
apps/web/core/components/issues/issue-layouts/quick-add/root.tsx
Toast errors support multiple error shapes, and title validation messages render inline beneath the open quick-add form.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: sriramveeraghanta

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main fix for quick-add title validation and field error surfacing.
Description check ✅ Passed The description follows the template and includes the change summary, type of change, test scenarios, and reference.
Linked Issues check ✅ Passed The PR addresses #9329 by adding 255-char validation, showing field errors inline, and aligning quick-add behavior with modal flow.
Out of Scope Changes check ✅ Passed The additional toast parsing and optimistic rollback changes are in scope because they directly support the reported quick-add error handling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: Inline work item creation shows generic error when title exceeds 255 characters

1 participant