Skip to content

feat(canisters): allow canister names up to 64 characters - #8013

Merged
yhabib merged 3 commits into
mainfrom
feat/canister-name-limit-64-frontend
Sep 2, 2026
Merged

feat(canisters): allow canister names up to 64 characters#8013
yhabib merged 3 commits into
mainfrom
feat/canister-name-limit-64-frontend

Conversation

@yhabib

@yhabib yhabib commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Motivation

The backend accepts canister names up to 64 characters since #8012. The frontend still validates against the old 24-character limit. A 64-character name can also be one long word, so the detail page and the top-up confirm screen need a wrap rule for it.

Changes

  • Raised MAX_CANISTER_NAME_LENGTH from 24 to 64.
  • Updated the error__canister.name_too_long message to state 64 characters.
  • Added overflow-wrap: anywhere to the canister heading title, the heading subtitle, and the name on the cycles confirm screen.
  • Updated the tests that hardcoded the old limit in names and messages.

Prev. #8012

@yhabib
yhabib requested a review from a team as a code owner August 31, 2026 06:07
@zeropath-ai

zeropath-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 3d101e4.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► frontend/src/lib/api/canisters.api.ts
    Add $max to CanisterNameTooLongError payload
► frontend/src/lib/canisters/nns-dapp/nns-dapp.canister.ts
    Pass $max to CanisterNameTooLongError in responses
► frontend/src/lib/components/canister-detail/CanisterHeadingTitle.svelte
    Enable overflow-wrap: anywhere for long canister names
Enhancement ► frontend/src/lib/components/canister-detail/CanisterPageHeading.svelte
    Break long canister names in subtitle (breakLongWords)
Enhancement ► frontend/src/lib/components/canisters/ConfirmCyclesCanister.svelte
    Show canister name with overflow-wrap: anywhere and right alignment in value
Enhancement ► frontend/src/lib/components/common/HeadingSubtitle.svelte
    Add breakLongWords prop to enable long-word wrapping in subtitle
Enhancement ► frontend/src/lib/constants/canisters.constants.ts
    Increase MAX_CANISTER_NAME_LENGTH from 24 to 64
Enhancement ► frontend/src/lib/i18n/en.json
    name_too_long message now uses $max placeholder instead of fixed value 24
Bug Fix ► frontend/src/tests/lib/api/canisters.api.spec.ts
    Update tests to expect dynamic $max in CanisterNameTooLongError payload
Enhancement ► frontend/src/tests/lib/modals/canisters/LinkCanisterModal.spec.ts
    Update test to reflect new max length in error text
Enhancement ► frontend/src/tests/lib/modals/canisters/RenameCanisterModal.spec.ts
    Update test description to reference new maximum length
Enhancement ► frontend/src/tests/lib/utils/canisters.utils.spec.ts
    Update expectations to use dynamic MAX_CANISTER_NAME_LENGTH in error message

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the frontend to match the backend’s 64-character canister-name limit, including UI tweaks to safely display long single-word names and aligning related tests/messages.

Changes:

  • Increased MAX_CANISTER_NAME_LENGTH from 24 to 64 and updated validation-related copy.
  • Added overflow-wrap: anywhere to canister heading title/subtitle and the cycles top-up confirm screen name display.
  • Updated tests to reflect the new length limit and updated error text.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
frontend/src/lib/constants/canisters.constants.ts Raises max canister name length constant to 64.
frontend/src/lib/i18n/en.json Updates canister “name too long” translation to mention 64.
frontend/src/lib/components/common/HeadingSubtitle.svelte Adds overflow-wrap: anywhere in shared subtitle component.
frontend/src/lib/components/canisters/ConfirmCyclesCanister.svelte Wraps/aligns canister name on cycles confirm screen.
frontend/src/lib/components/canister-detail/CanisterHeadingTitle.svelte Adds wrapping rule for long canister names in heading title.
frontend/src/tests/lib/utils/canisters.utils.spec.ts Updates expected “too long” error message to 64.
frontend/src/tests/lib/modals/canisters/RenameCanisterModal.spec.ts Updates test description to no longer hardcode “24 characters”.
frontend/src/tests/lib/modals/canisters/LinkCanisterModal.spec.ts Updates expected “too long” error message to 64.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread frontend/src/tests/lib/utils/canisters.utils.spec.ts Outdated
Comment thread frontend/src/tests/lib/modals/canisters/LinkCanisterModal.spec.ts
Comment thread frontend/src/lib/i18n/en.json Outdated
Comment thread frontend/src/lib/components/common/HeadingSubtitle.svelte

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

The changes consistently update the max-length constraint, error parameterization, UI wrapping behavior, and the associated test expectations without introducing incomplete call sites or mismatched i18n substitutions.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Comment thread frontend/src/lib/components/canisters/ConfirmCyclesCanister.svelte Outdated
@yhabib
yhabib added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit 4bd5f0e Sep 2, 2026
33 checks passed
@yhabib
yhabib deleted the feat/canister-name-limit-64-frontend branch September 2, 2026 20:48
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.

3 participants