Skip to content

fix(projects): show the project name in the delete confirmation - #1827

Merged
chrisvel merged 1 commit into
chrisvel:mainfrom
rome-xi:fix/1826-delete-project-name
Oct 14, 2026
Merged

chrisvel merged 1 commit into
chrisvel:mainfrom
rome-xi:fix/1826-delete-project-name

Conversation

@rome-xi

@rome-xi rome-xi commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Description

In ProjectDetails.tsx and ProjectModal.tsx, the delete confirmation dialog called t('modals.deleteProject.message', ...) without supplying interpolation parameters. In 23 non-English locales (such as Polish, German, and French), modals.deleteProject.message contains {{projectName}}, which caused the dialog to render the literal placeholder "{{projectName}}" instead of the project name.

This updates both call sites to pass projectName: project?.name alongside the English defaultValue.

Type of Change

  • Bug fix (fixes an issue)
  • New feature (adds functionality)
  • Breaking change (breaks existing functionality)
  • Documentation/Translation update

Related Issues

Fixes #1826

Testing

How did you test this?

Added unit tests covering delete confirmation dialog rendering and variable interpolation in ProjectDetails and ProjectModal:

  • npx jest frontend/components/Project/__tests__/ProjectModal.test.tsx frontend/components/Project/__tests__/ProjectDetails.test.tsx
  • npx eslint frontend/components/Project/ProjectModal.tsx frontend/components/Project/ProjectDetails.tsx frontend/components/Project/__tests__/ProjectModal.test.tsx frontend/components/Project/__tests__/ProjectDetails.test.tsx
  • npx prettier --check frontend/components/Project/ProjectModal.tsx frontend/components/Project/ProjectDetails.tsx frontend/components/Project/__tests__/ProjectModal.test.tsx frontend/components/Project/__tests__/ProjectDetails.test.tsx

Checklist

  • This is not an AI slop crap, I know what I am doing
  • Self-reviewed my own code, follows project style guidelines
  • Tests, docs, migrations, and translations updated (if applicable)

@chrisvel chrisvel left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks, this is the right fix: passing projectName through t() is all the locales that use the placeholder needed, and the two tests pin it down nicely.

One thing before merging: main changed the project menu button since this branch was cut, so the ProjectDetails test fails after a merge with main (the ProjectModal one is fine). See the inline note, it is a one-word change. I ran both tests on a local merge with main and they pass with it.

expect(screen.getByText('Apollo Moon Mission')).toBeInTheDocument();
});

fireEvent.click(screen.getByTitle('More options'));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

On current main this button only has an aria-label (the title went away in #1832), so this throws Unable to find an element with the title: More options. screen.getByLabelText('More options') finds it.

@rome-xi

rome-xi commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review, and for landing the fix in #1857. That covers #1826, so the component change here is redundant now.

#1857 mentions that no regression test went in because the test mock doesn't interpolate. The two tests in this PR do check that projectName reaches the dialog. Would you like me to trim this PR down to just those tests on top of current main (with the getByLabelText('More options') change you pointed out)? If not, I'll close it.

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] Project removal - name not rendered

2 participants