Skip to content

fix(admin): restore SearchField + sorting modules used by AuthorPage#7746

Merged
JohnMcLear merged 2 commits into
ether:developfrom
JohnMcLear:fix/admin-build-restore-orphan-imports
May 15, 2026
Merged

fix(admin): restore SearchField + sorting modules used by AuthorPage#7746
JohnMcLear merged 2 commits into
ether:developfrom
JohnMcLear:fix/admin-build-restore-orphan-imports

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Summary

  • Restores admin/src/components/SearchField.tsx and admin/src/utils/sorting.ts, which fix(admin): replace hardcoded German strings with i18n keys (#7735) #7736 deleted as "orphan modules" before feat(gdpr): admin UI for author erasure (follow-up to #7550) #7667 (GDPR admin AuthorPage) merged and reintroduced the imports.
  • Without these files develop's admin build fails with TS2307: Cannot find module '../components/SearchField.tsx' (and a knock-on TS7006 implicit-any on the SearchField onChange callback), which is what's currently breaking Backend tests, Frontend admin tests, Docker (build-test / build-test-local-plugin / build-test-db-drivers), rate limit, and Upgrade from latest release on develop.

Why this happened

  1. chore: fixed admin design rework #7716 (admin design rework) restructured admin pages and removed the last consumer of SearchField / determineSorting.
  2. fix(admin): replace hardcoded German strings with i18n keys (#7735) #7736 noticed the orphans and deleted both files on 2026-05-12.
  3. feat(gdpr): admin UI for author erasure (follow-up to #7550) #7667 (GDPR author-erasure UI) — written off an older base — merged after fix(admin): replace hardcoded German strings with i18n keys (#7735) #7736 and added admin/src/pages/AuthorPage.tsx, which still imports SearchField and determineSorting.

Develop now has an AuthorPage.tsx whose imports point at deleted files. Every CI job that runs pnpm --filter admin run build-copy (directly or transitively through Docker / Backend tests / Frontend admin tests) fails at the tsc step.

The fix

Restore both files verbatim from ff7c4d531^. This is the minimum change needed to make develop's admin build pass again. Inlining the two helpers into AuthorPage.tsx (or deleting them again together with their consumers) can be done as follow-up cleanup.

Test plan

  • cd admin && pnpm exec tsc --noEmit — no errors
  • cd admin && pnpm exec tsc && pnpm exec vite build — built in 545ms; admin bundle written to src/templates/admin
  • CI: Backend tests, Frontend admin tests, Docker, rate limit, Upgrade from latest release all back to green

🤖 Generated with Claude Code

PR ether#7736 ("replace hardcoded German strings with i18n keys") deleted
admin/src/components/SearchField.tsx and admin/src/utils/sorting.ts as
"orphan modules (no longer imported anywhere after ether#7716)". At that
point, the GDPR admin AuthorPage (PR ether#7667) had not yet landed on
develop. When ether#7667 merged afterwards, the new admin/src/pages/AuthorPage.tsx
brought back imports of SearchField and determineSorting — but the
files were already gone, leaving develop with broken admin imports.

This breaks `pnpm --filter admin run build-copy` on every CI job that
builds the admin UI:

  src/pages/AuthorPage.tsx(6,27): error TS2307: Cannot find module
    '../components/SearchField.tsx' or its corresponding type
    declarations.
  src/pages/AuthorPage.tsx(9,32): error TS2307: Cannot find module
    '../utils/sorting.ts' or its corresponding type declarations.
  src/pages/AuthorPage.tsx(207,29): error TS7006: Parameter 'v'
    implicitly has an 'any' type.

Backend tests, Frontend admin tests, Docker (build-test,
build-test-local-plugin, build-test-db-drivers), rate limit, and
Upgrade from latest release all fail at the admin build step on
develop.

Restore both files verbatim from before the deletion (commit ff7c4d5^).
With them back in place AuthorPage.tsx's existing imports resolve, the
implicit-any on the SearchField onChange callback goes away (typed via
SearchFieldProps), and `pnpm --filter admin run build-copy` succeeds.

This is the minimal, surgical fix; whether SearchField / determineSorting
should ultimately be inlined into AuthorPage is a separate cleanup.

Test plan:
  - cd admin && pnpm exec tsc --noEmit        → no errors
  - cd admin && pnpm exec tsc && pnpm exec vite build → built in 545ms

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Review Summary by Qodo

Restore SearchField and sorting modules for AuthorPage

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Restores deleted SearchField and sorting modules
• Fixes broken admin build imports in AuthorPage
• Resolves TypeScript compilation errors TS2307 and TS7006
• Unblocks CI pipeline failures across multiple jobs
Diagram
flowchart LR
  A["PR #7736 deleted<br/>SearchField + sorting"] --> B["PR #7667 merged<br/>with AuthorPage imports"]
  B --> C["Broken imports<br/>TS2307 errors"]
  C --> D["CI failures:<br/>admin build"]
  D --> E["Restore files<br/>from ff7c4d531"]
  E --> F["AuthorPage imports<br/>resolve successfully"]
Loading

Grey Divider

File Changes

1. admin/src/utils/sorting.ts 🐞 Bug fix +6/-0

Restore sorting utility function

• Restores utility function determineSorting for sort state management
• Determines sort icon display based on current sort column and direction
• Returns 'sort up', 'sort down', or 'sort none' based on parameters

admin/src/utils/sorting.ts


2. admin/src/components/SearchField.tsx 🐞 Bug fix +14/-0

Restore SearchField component with types

• Restores React SearchField component with TypeScript types
• Exports SearchFieldProps type for proper typing of onChange callback
• Implements search input with lucide-react Search icon
• Resolves implicit-any error on SearchField onChange parameter

admin/src/components/SearchField.tsx


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

qodo-free-for-open-source-projects Bot commented May 15, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

…rPage imports them

PR ether#7736 added a lint assertion that admin/src/components/SearchField.tsx
and admin/src/utils/sorting.ts must NOT exist, on the assumption they
were dead code after ether#7716. They aren't — the GDPR AuthorPage (ether#7667)
imports both. The previous commit restored the files; this commit flips
the assertion so the test:

  - verifies both files exist
  - verifies admin/src/pages/AuthorPage.tsx still imports them

If a future cleanup wants to delete these modules, the test now forces
the author to also delete or refactor the AuthorPage consumption first,
preventing a repeat of the merge-order accident that produced this bug.

Test plan:
  - cd src && pnpm exec vitest run tests/backend-new/specs/admin-i18n-source-lint.test.ts
    → 14 passed (14)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JohnMcLear JohnMcLear mentioned this pull request May 15, 2026
@JohnMcLear JohnMcLear merged commit 02e00ad into ether:develop May 15, 2026
18 of 19 checks passed
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.

1 participant