[WEB-4196]fix: toast message for sub work item quick actions#7688
[WEB-4196]fix: toast message for sub work item quick actions#7688
Conversation
WalkthroughUnifies sub-issue toast messages to use generic Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant UI as User Action
participant Helper as sub-issues/helper
participant Service as issueService
participant Toast as Toast System
rect #DFF2FF
UI->>Helper: trigger action (copy/fetch/add/remove/delete)
Helper->>Service: determine issueServiceType & associated issueIds
Service-->>Helper: issueServiceType, issue, issueIds
alt ISSUES
Helper->>Toast: show entity.* using common.sub_work_items (no count)
else non-ISSUES
Helper->>Toast: show entity.* using issue.label (with count)
end
Toast-->>UI: display localized message
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Pull Request Linked with Plane Work Items Comment Automatically Generated by Plane |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
apps/web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts (2)
160-171: Compute analytics inputs before removal to avoid stale/undefined reads.getIssueById runs after await removeSubIssue; the issue may have been evicted, breaking analytics updates. Capture before awaiting.
- setSubIssueHelpers(parentIssueId, "issue_loader", issueId); - await removeSubIssue(workspaceSlug, projectId, parentIssueId, issueId); - if (issueServiceType === EIssueServiceType.EPICS) { - const issueBeforeRemoval = getIssueById(issueId); + setSubIssueHelpers(parentIssueId, "issue_loader", issueId); + const issueBeforeRemoval = + issueServiceType === EIssueServiceType.EPICS ? getIssueById(issueId) : undefined; + await removeSubIssue(workspaceSlug, projectId, parentIssueId, issueId); + if (issueServiceType === EIssueServiceType.EPICS) {
205-231: deleteSubIssue errors won’t trigger; promise rejection is not caught.Returning the promise from try means the catch never runs on rejection. Await the deletion or attach .catch.
- try { - setSubIssueHelpers(parentIssueId, "issue_loader", issueId); - return deleteSubIssue(workspaceSlug, projectId, parentIssueId, issueId).then(() => { - captureSuccess({ - eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.delete, - payload: { id: issueId, parent_id: parentIssueId }, - }); - setSubIssueHelpers(parentIssueId, "issue_loader", issueId); - }); - } catch (error) { + try { + setSubIssueHelpers(parentIssueId, "issue_loader", issueId); + await deleteSubIssue(workspaceSlug, projectId, parentIssueId, issueId); + captureSuccess({ + eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.delete, + payload: { id: issueId, parent_id: parentIssueId }, + }); + setSubIssueHelpers(parentIssueId, "issue_loader", issueId); + } catch (error) { captureError({ eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.delete, payload: { id: issueId, parent_id: parentIssueId }, error: error as Error, }); setToast({ type: TOAST_TYPE.ERROR, title: t("toast.error"), - message: t("entity.delete.failed", { - entity: - issueServiceType === EIssueServiceType.ISSUES - ? t("common.sub_work_items") - : t("issue.label", { count: 1 }), - }), + message: t("entity.delete.failed", { + entity: + issueServiceType === EIssueServiceType.ISSUES + ? t("common.sub_work_item") + : t("issue.label", { count: 1 }), + }), }); }
🧹 Nitpick comments (1)
apps/web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts (1)
49-52: Use singular label for single-entity copy and avoid passing unused count.common.sub_work_items is plural and doesn’t use the count param. Prefer the singular for one item.
- entity: - issueServiceType === EIssueServiceType.ISSUES - ? t("common.sub_work_items", { count: 1 }) - : t("issue.label", { count: 1 }), + entity: + issueServiceType === EIssueServiceType.ISSUES + ? t("common.sub_work_item") + : t("issue.label", { count: 1 }),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
apps/web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts(6 hunks)packages/i18n/src/locales/en/translations.json(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts (1)
packages/i18n/src/store/index.ts (1)
t(210-231)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build and lint web apps
- GitHub Check: Analyze (javascript)
apps/web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts
Show resolved
Hide resolved
apps/web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts
Show resolved
Hide resolved
apps/web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (9)
packages/i18n/src/locales/pt-BR/translations.json (1)
922-925: Nit: unify failure phrasing across entity. (pt-BR)*Consider aligning to “Falha ao …” used by delete/update for consistency.
Apply within this hunk:
- "failed": "Erro ao remover {entity}" + "failed": "Falha ao remover {entity}"packages/i18n/src/locales/sk/translations.json (1)
924-924: Nit: align failure wording with existing “zlyhalo/zlyhala” patternElsewhere this locale prefers “zlyhalo/zlyhala” (e.g., delete.failed). Consider:
- "failed": "Chyba pri odstraňovaní {entity}" + "failed": "Odstránenie {entity} zlyhalo"packages/i18n/src/locales/ko/translations.json (1)
922-925: Optional: standardize failure phrasing within entity. (follow-up)*This file mixes “… 실패” and “… 오류 발생”. Consider choosing one style across add/update/delete/remove in a later sweep.
packages/i18n/src/locales/ua/translations.json (1)
921-925: Use “вилучено/вилучення” for non-destructive remove (consistency with UA locale).UA strings elsewhere use “вилучити/вилучено” for remove (e.g., favorites, sub_work_item.remove). Recommend aligning to avoid conflating with “видалити/видалено” (delete).
Apply:
- "success": "{entity} успішно видалено", - "failed": "Помилка під час видалення {entity}" + "success": "{entity} успішно вилучено", + "failed": "Помилка під час вилучення {entity}"packages/i18n/src/locales/fr/translations.json (1)
921-924: Prefer “retiré/retrait” for non-destructive remove (avoid overlap with delete).FR already mixes “retirer” for favorites and “supprimer” for delete. Using “retiré” here makes the generic entity.remove safer across contexts.
Apply:
- "success": "{entity} supprimé avec succès", - "failed": "Erreur lors de la suppression de {entity}" + "success": "{entity} retiré avec succès", + "failed": "Erreur lors du retrait de {entity}"packages/i18n/src/locales/cs/translations.json (1)
898-924: Optional: check generic grammar across entities.Because {entity} can be various genders/numbers in CZ, the fixed feminine participle may read oddly for some labels. If this surfaces UX feedback later, consider neutral rephrasing (e.g., “{entity} bylo úspěšně odebráno”). Low priority.
packages/i18n/src/locales/de/translations.json (1)
919-923: Add entity.remove translations — LGTM; consider copy consistencyStrings read well. For consistency with delete.failed (“{entity} konnte nicht gelöscht werden”), consider mirroring tone/structure:
- "failed": "Fehler beim Entfernen von {entity}" + "failed": "{entity} konnte nicht entfernt werden"packages/i18n/src/locales/pl/translations.json (1)
918-925: Polish copy: align style with existing delete. messages*Minor consistency: match word order and tone used in delete.success/failed.
- "success": "{entity} usunięto pomyślnie", - "failed": "Błąd podczas usuwania {entity}" + "success": "{entity} pomyślnie usunięto", + "failed": "Nie udało się usunąć {entity}"packages/i18n/src/locales/ja/translations.json (1)
917-924: Tweak Japanese remove.failed copy for consistency
Align with existing 「entity.delete.failed」 phrasing:- "failed": "{entity}の削除中にエラーが発生しました" + "failed": "{entity}の削除に失敗しました"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (18)
packages/i18n/src/locales/cs/translations.json(1 hunks)packages/i18n/src/locales/de/translations.json(1 hunks)packages/i18n/src/locales/es/translations.json(1 hunks)packages/i18n/src/locales/fr/translations.json(1 hunks)packages/i18n/src/locales/id/translations.json(1 hunks)packages/i18n/src/locales/it/translations.json(1 hunks)packages/i18n/src/locales/ja/translations.json(1 hunks)packages/i18n/src/locales/ko/translations.json(1 hunks)packages/i18n/src/locales/pl/translations.json(1 hunks)packages/i18n/src/locales/pt-BR/translations.json(1 hunks)packages/i18n/src/locales/ro/translations.json(1 hunks)packages/i18n/src/locales/ru/translations.json(1 hunks)packages/i18n/src/locales/sk/translations.json(1 hunks)packages/i18n/src/locales/tr-TR/translations.json(1 hunks)packages/i18n/src/locales/ua/translations.json(1 hunks)packages/i18n/src/locales/vi-VN/translations.json(1 hunks)packages/i18n/src/locales/zh-CN/translations.json(1 hunks)packages/i18n/src/locales/zh-TW/translations.json(1 hunks)
✅ Files skipped from review due to trivial changes (4)
- packages/i18n/src/locales/it/translations.json
- packages/i18n/src/locales/ru/translations.json
- packages/i18n/src/locales/zh-TW/translations.json
- packages/i18n/src/locales/vi-VN/translations.json
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-03-11T19:42:41.769Z
Learnt from: janreges
PR: makeplane/plane#6743
File: packages/i18n/src/store/index.ts:160-161
Timestamp: 2025-03-11T19:42:41.769Z
Learning: In the Plane project, the file 'packages/i18n/src/store/index.ts' already includes support for Polish language translations with the case "pl".
Applied to files:
packages/i18n/src/locales/pl/translations.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build and lint web apps
🔇 Additional comments (14)
packages/i18n/src/locales/pt-BR/translations.json (1)
922-925: Add entity.remove translations — LGTMKeys and placeholders are correct; matches existing entity.* patterns.
packages/i18n/src/locales/sk/translations.json (2)
922-925: Add entity.remove translations — LGTMConsistent with existing “delete/add” semantics and Slovak style.
922-925: Verify coverage across locales and placeholdersRun the same script shared in the pt-BR comment to ensure all locales contain entity.remove.* with {entity}.
packages/i18n/src/locales/ko/translations.json (2)
922-925: Add entity.remove translations — LGTMWording and particles look natural; mirrors existing add/delete patterns.
922-925: Verify coverage across locales and placeholdersRun the repository-wide check script from the pt-BR comment to confirm consistency.
packages/i18n/src/locales/ua/translations.json (1)
900-926: Sanity-check usage of entity.remove vs entity.delete across the app.Ensure remove is only used for detach/unlink scenarios and delete remains for destructive operations, to keep copy semantically correct in all toasts. I can provide a repo-wide check to list call sites triggering these keys if helpful.
packages/i18n/src/locales/fr/translations.json (1)
900-925: Verify downstream contexts using entity.remove.If any context truly deletes the entity, they should still use entity.delete to keep copy precise.
packages/i18n/src/locales/cs/translations.json (1)
919-923: LGTM — consistent with existing “add” phrasing.“odebrána” mirrors the feminine past participle used in “přidána”; matches existing locale style.
packages/i18n/src/locales/pl/translations.json (1)
918-925: Verified: entity.remove placeholders present in all locales
Allentity.remove.successandentity.remove.failedkeys include the{entity}placeholder and JSON files are valid.packages/i18n/src/locales/id/translations.json (2)
920-923: LGTM: entity.remove strings added and consistent with locale tone.
Wording matches existing delete semantics and placeholder usage.
919-920: Locale JSON syntax is valid
All modified locale translation files parse without errors, confirming the comma betweenentity.addandentity.removeis correctly present.packages/i18n/src/locales/es/translations.json (1)
923-926: LGTM: Added entity.remove with correct Spanish phrasing.
Copy aligns with existing entity.delete and uses consistent placeholders.packages/i18n/src/locales/tr-TR/translations.json (1)
924-927: LGTM: Turkish entity.remove strings read naturally.
Using “kaldırıldı/kaldırılırken” differentiates from hard delete, which is fine.packages/i18n/src/locales/ro/translations.json (1)
916-923: Add: entity.remove — Romanian copy reads well and matches “remove” (vs. “delete”) semanticsNo issues. Consistent with existing add/delete phrasing.
Reuse the locale-wide verification script shared in the JA comment to confirm presence/validity across all locales.
| "remove": { | ||
| "success": "{entity} removido com sucesso", | ||
| "failed": "Erro ao remover {entity}" | ||
| } |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify coverage across locales and placeholders
Ensure every locale defines entity.remove.success/failed and both include “{entity}”.
🏁 Script executed:
#!/bin/bash
set -euo pipefail
root="packages/i18n/src/locales"
missing=0
# Validate JSON and check keys/placeholders
fd translations.json "$root" -t f | while read -r f; do
if ! jq -e 'has("entity") and .entity|has("remove") and .entity.remove|has("success") and .entity.remove|has("failed")' "$f" >/dev/null; then
echo "MISSING keys: $f"
missing=$((missing+1))
continue
fi
for k in success failed; do
val=$(jq -r ".entity.remove.$k" "$f")
if [[ "$val" != *"{entity}"* ]]; then
echo "PLACEHOLDER missing in $k: $f -> $val"
missing=$((missing+1))
fi
done
done
if [[ $missing -eq 0 ]]; then
echo "All locales OK: entity.remove.success/failed present with {entity}."
else
echo "Found $missing issues."
exit 1
fiLength of output: 8797
Add missing entity.remove translations across locales
The following locale files lack entity.remove.success/failed entries with the {entity} placeholder:
- packages/i18n/src/locales/cs/translations.json
- packages/i18n/src/locales/de/translations.json
- packages/i18n/src/locales/en/translations.json
- packages/i18n/src/locales/es/translations.json
- packages/i18n/src/locales/fr/translations.json
- packages/i18n/src/locales/id/translations.json
- packages/i18n/src/locales/it/translations.json
- packages/i18n/src/locales/ja/translations.json
- packages/i18n/src/locales/ko/translations.json
- packages/i18n/src/locales/pl/translations.json
- packages/i18n/src/locales/pt-BR/translations.json
- packages/i18n/src/locales/ro/translations.json
- packages/i18n/src/locales/ru/translations.json
- packages/i18n/src/locales/sk/translations.json
- packages/i18n/src/locales/tr-TR/translations.json
- packages/i18n/src/locales/ua/translations.json
- packages/i18n/src/locales/vi-VN/translations.json
- packages/i18n/src/locales/zh-CN/translations.json
- packages/i18n/src/locales/zh-TW/translations.json
In each, add under the entity key:
"remove": {
"success": "{entity} removido com sucesso",
"failed": "Erro ao remover {entity}"
}(adjust wording per locale, keeping the {entity} placeholder in both messages)
🤖 Prompt for AI Agents
In packages/i18n/src/locales/pt-BR/translations.json around lines 922 to 925,
the entity.remove translations are present for pt-BR but reviewer notes many
other locale files are missing entity.remove.success and entity.remove.failed
entries; for each listed locale file (cs, de, en, es, fr, id, it, ja, ko, pl,
pt-BR, ro, ru, sk, tr-TR, ua, vi-VN, zh-CN, zh-TW) add an "remove" object under
the "entity" key with two entries: a success message and a failed message that
both include the "{entity}" placeholder; translate the wording appropriately per
locale while preserving the {entity} token exactly and place the entries in the
same structure/location as other entity messages to keep consistency.
| "remove": { | ||
| "success": "{entity}删除成功", | ||
| "failed": "删除{entity}时出错" | ||
| } |
There was a problem hiding this comment.
Fix mistranslation: use 移除 for “remove”, not 删除
“remove” ≠ “delete”. Elsewhere you use “移除” for remove (e.g., 子工作项移除成功). Update both keys to avoid user-facing confusion.
- "success": "{entity}删除成功",
- "failed": "删除{entity}时出错"
+ "success": "{entity}移除成功",
+ "failed": "移除{entity}时出错"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "remove": { | |
| "success": "{entity}删除成功", | |
| "failed": "删除{entity}时出错" | |
| } | |
| "remove": { | |
| "success": "{entity}移除成功", | |
| "failed": "移除{entity}时出错" | |
| } |
🤖 Prompt for AI Agents
In packages/i18n/src/locales/zh-CN/translations.json around lines 921–924, the
translations use 删除 for the "remove" key which conflicts with other usages that
use 移除; change the values to use 移除 (e.g., "success": "{entity}移除成功", "failed":
"移除{entity}时出错") and ensure both keys are updated so the wording matches other
locales/entries that use 移除 for remove.
Description
Improves toast message accuracy and consistency when working with sub-issues and issues by fixing entity labels, adding proper pluralisation, and enhancing error/success message handling. Includes new translation strings for entity remove operations to provide better user feedback.
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
Summary by CodeRabbit
New Features
Refactor
Bug Fixes