chore: remove dead and non-functional code - #182
chore: remove dead and non-functional code#182Caleb Robinson (calebrob6) wants to merge 6 commits into
Conversation
Delete four unused UI components and one unused helper. Remove the two admin create controls whose duplicate dialogs contained uncontrolled inputs and a Submit button with no handler, validation, or API call. Existing list, sort, and remove behavior is unchanged. Remove four package-level sys.path mutations from hastegeo. Repository- wide AST search found no bare sibling imports, and qualified imports work without changing process-global import state. Fixes #181. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rubber-duck review found the same non-functional action pattern in the admin row menus: Base Model Edit/Remove and Source Type Edit/Remove had no callbacks. Remove the Base Model menu entirely and keep only Source Type's working mobile View/Hide Info action. Deleting DisasterEvents also left its sole direct dependency and fetch target behind. Remove d3 from the locked UI dependency tree and delete the orphaned public world GeoJSON; the separate country-boundary asset used by live project forms remains. Refs #181. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
RC artifacts readyAll branch deployment references use the same RC tag:
|
Issue #181 and the cleanup README already capture the scope, rationale, and validation. A separate design document duplicates them without adding an API, data model, or architecture contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Removes verified dead code, dependencies, assets, and non-functional admin controls while preserving active list and responsive behavior.
Changes:
- Deletes unused UI components, dialogs, map data, and
d3. - Removes non-functional admin actions.
- Removes Python import-time path mutation and documents the cleanup.
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
ui/src/util/api.js |
Removes unused helper. |
ui/src/Components/ProjectManagement/SourceTypeRow.jsx |
Removes stub actions. |
ui/src/Components/ProjectManagement/BaseModelRow.jsx |
Removes stub overflow menu. |
ui/src/Components/ImageLayerInfoModal.jsx |
Deletes unused modal. |
ui/src/Components/Home/DisasterEvents.jsx |
Deletes unused map component. |
ui/src/Components/HelpDocs/HelpDocsPrevNext.jsx |
Deletes unused navigation component. |
ui/src/Components/CreateEditSourceTypeModal.jsx |
Deletes non-functional dialog. |
ui/src/Components/CreateEditBaseModelModal.jsx |
Deletes non-functional dialog. |
ui/src/Components/AdminSourceTypes.jsx |
Removes create control and modal state. |
ui/src/Components/AdminBaseModels.jsx |
Removes create control and aligns table columns. |
ui/package.json |
Removes direct d3 dependency. |
ui/package-lock.json |
Regenerates dependency lock data. |
ui/public/assets/geo/world.geojson |
Deletes orphaned map asset. |
spec/features/dead-code-cleanup/README.md |
Defines cleanup scope and criteria. |
spec/features/dead-code-cleanup/design.md |
Documents implementation and validation. |
hastelib/src/hastegeo/core/utils/__init__.py |
Removes path mutation. |
hastelib/src/hastegeo/core/processors/__init__.py |
Removes path mutation. |
hastelib/src/hastegeo/core/models/__init__.py |
Removes path mutation. |
hastelib/src/hastegeo/core/data_layer/__init__.py |
Removes path mutation. |
Files not reviewed (1)
- ui/package-lock.json: Generated file
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| text: "Remove", | ||
| icon: <FluentIcon name="Delete" />, | ||
| }, | ||
| ], |
There was a problem hiding this comment.
Good catch, and confirmed on the local dev stack: at ≥992px the trigger rendered but the popover was empty, since View/Hide Info was the only item left and it carries d-lg-none (.d-lg-none{display:none!important} lives inside @media (min-width:992px) in the bundled Bootstrap 5.3).
Worth fixing rather than a nitpick, for two reasons: it is the same class of visible non-functional control this branch exists to remove, and BaseModelRow in this very PR takes the opposite path — once its stub items were gone the whole menu went too.
Fixed in 4197cc8 by the second of your two options, adapted slightly: the trigger now sits behind the same breakpoint as its only item, via a wrapper inside the existing cell so the row keeps its column count (the header is already one th short of the row's four tds, so dropping the cell would have shifted the layout). Both the item and the wrapper read one MOBILE_ONLY constant so they cannot drift apart.
For contrast, UserRow uses the same d-block d-lg-none pattern but keeps Re-send Invitation, Edit and Remove with no responsive class, so its trigger is justified at every width. SourceTypeRow was the only remaining desktop-empty menu.
Removing Edit and Remove left one item in this menu, and it is mobile only: View/Hide Info carries d-lg-none because at lg and above the Base URL and Creation Date columns are already in the table. The trigger had no matching class, so from 992px up the button stayed visible and opened an empty popover. That is the same kind of visible non-functional control this branch set out to delete, and BaseModelRow already takes the other path: once its stub items were gone, the whole menu went with them. The trigger now sits behind the same breakpoint as its only item, in a wrapper inside the existing cell so the row keeps its column count. Both read one MOBILE_ONLY constant, so they cannot drift apart. Reported by Copilot in review.
Issue #181 already contains the scope and acceptance criteria, while the PR contains the implementation rationale and validation. The repository README repeated both without adding a durable contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The responsive info menu replaces Base URL and Creation Date below xl. Hide its action cell at the same xl breakpoint where those columns appear, while preserving the existing right alignment at compact widths. Refs #181. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
RC artifacts readyAll branch deployment references use the same RC tag:
|
RC artifacts readyAll branch deployment references use the same RC tag:
|
Fixes #181.
Summary
ImageLayerInfoModal,DisasterEvents, andHelpDocsPrevNextcomponents.resolveVarConcatCharAPI helper.d3andui/public/assets/geo/world.geojson, whose only consumer wasDisasterEvents. Keep the separate country-boundary GeoJSON used by live forms.sys.path.append(...)side effects from themodels,processors,data_layer, andutilspackages.Validation
npm ci --dry-runpassed against the updated lockfile.d3imports, or references to the removed asset.sys.path.git diff --checkpassed.Rubber-duck review
The independent pass found two valid omissions in the first commit:
DisasterEventsleft its sole dependency (d3) and fetch target (public/assets/geo/world.geojson) orphaned. Both are now removed.It found no dynamic reachability, packaging, import, or runtime dependency on the deleted modules or Python path shims.
Follow-up review also caught the Source Type menu trigger remaining visible when its only item was responsive-only. The final version keeps the info menu through the same
xlbreakpoint where Base URL and Creation Date columns appear, then hides the whole action cell. Ad-hoc Playwright checks passed at 375px, 1100px, and 1300px (39 assertions, no console or page errors).Scope
Implementing base-model or source-type creation/edit/removal and other simplification-audit findings remain out of scope.