Skip to content

chore: remove dead and non-functional code - #182

Open
Caleb Robinson (calebrob6) wants to merge 6 commits into
mainfrom
calebrob6/chore/remove-dead-code
Open

chore: remove dead and non-functional code#182
Caleb Robinson (calebrob6) wants to merge 6 commits into
mainfrom
calebrob6/chore/remove-dead-code

Conversation

@calebrob6

@calebrob6 Caleb Robinson (calebrob6) commented Aug 31, 2026

Copy link
Copy Markdown
Member

Fixes #181.

Summary

  • Delete unused ImageLayerInfoModal, DisasterEvents, and HelpDocsPrevNext components.
  • Delete the unused resolveVarConcatChar API helper.
  • Remove the non-functional Base Model and Source Type create controls and their duplicate stub dialogs.
  • Remove the non-functional Base Model Edit/Remove menu and Source Type Edit/Remove items. Preserve Source Type mobile View/Hide Info behavior.
  • Remove direct UI dependency d3 and ui/public/assets/geo/world.geojson, whose only consumer was DisasterEvents. Keep the separate country-boundary GeoJSON used by live forms.
  • Remove import-time sys.path.append(...) side effects from the models, processors, data_layer, and utils packages.

Validation

  • 94/94 discovered UI unit tests passed. These are pure-helper tests; none directly renders the changed admin pages.
  • 2/2 ad-hoc, noncommitted Playwright admin scenarios passed with no console, page, or request errors. Base Model header/cell alignment and sorting passed; Source Type mobile View/Hide Info passed.
  • Production UI build passed under the repository Node 24 image.
  • npm ci --dry-run passed against the updated lockfile.
  • Targeted ESLint introduced no findings and removed the existing unused-helper error.
  • Repository-wide searches found no remaining code references to deleted symbols, direct d3 imports, or references to the removed asset.
  • AST scan parsed 173 Python files with zero bare sibling imports.
  • 47 safe modules imported without changing sys.path.
  • 39 targeted Python tests passed.
  • Black, isort, flake8, detect-secrets, and git diff --check passed.

Rubber-duck review

The independent pass found two valid omissions in the first commit:

  1. Base Model and Source Type rows still exposed Edit/Remove menu items with no callbacks. Those are now removed; Source Type responsive info remains.
  2. Deleting DisasterEvents left 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 xl breakpoint 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.

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>
@calebrob6
Caleb Robinson (calebrob6) requested a review from a team as a code owner August 31, 2026 21:56
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>
@github-actions

Copy link
Copy Markdown

RC artifacts ready

All branch deployment references use the same RC tag:

  • hastegeo_version: 1.0.39rc10
  • training_image_tag: 1.0.39rc10
  • imageprep_image_tag: 1.0.39rc10
  • wheel: hastegeo-1.0.39rc10-py3-none-any.whl

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>

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

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" />,
},
],

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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>
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

RC artifacts ready

All branch deployment references use the same RC tag:

  • hastegeo_version: 1.0.39rc15
  • training_image_tag: 1.0.39rc15
  • imageprep_image_tag: 1.0.39rc15
  • wheel: hastegeo-1.0.39rc15-py3-none-any.whl

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

RC artifacts ready

All branch deployment references use the same RC tag:

  • hastegeo_version: 1.0.39rc16
  • training_image_tag: 1.0.39rc16
  • imageprep_image_tag: 1.0.39rc16
  • wheel: hastegeo-1.0.39rc16-py3-none-any.whl

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.

chore: remove dead and non-functional code

2 participants