Skip to content

refactor(theme/bootstrap): remove no-op home-view option select helpers#3172

Merged
marevol merged 2 commits into
masterfrom
chore/bootstrap-remove-deadcode-home-option-selects
Jun 22, 2026
Merged

refactor(theme/bootstrap): remove no-op home-view option select helpers#3172
marevol merged 2 commits into
masterfrom
chore/bootstrap-remove-deadcode-home-option-selects

Conversation

@marevol

@marevol marevol commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove helper functions that operate only on home-view option selects that no longer exist in the theme markup. Pure no-op cleanup; no behavior change.

Background

The home view was migrated to the shared #searchOptions drawer. The ids home-sort-select, home-num-select, home-lang-select, home-label-select are no longer rendered in index.html (and a check of the history shows they never were — they were introduced dead alongside the shared-drawer redesign). renderHomeOptions() and applyHomeOptions() still execute, but every getElementById for those ids returns null, so they have no effect. resetOptionsDOM() also looped over the same non-existent ids.

Changes

  • Remove renderHomeOptions() and its call in renderSearchOptions().
  • Remove applyHomeOptions(), its export, and its call in app.js's home search-form submit handler.
  • Remove the home-*-select loop in resetOptionsDOM().
  • Update BundledBootstrapThemeTest: the test that asserted search.js contains the literal home-sort-select now asserts what search.js actually does — populate the shared label multi-select (#labelSearchOption) via renderLabelOptions(). Renamed test_searchJs_populatesHomeOptionstest_searchJs_populatesLabelOption.

The home search-form submit still carries the keyword and navigates, and clearSearchState() still resets the live drawer controls. No live behavior changes.

Testing

  • node --check passes for the changed JS files.
  • Grep confirms no remaining references to the removed functions or the home-*-select ids.
  • The updated theme test asserts #labelSearchOption population, which search.js performs in renderLabelOptions().

marevol added 2 commits June 22, 2026 22:45
renderHomeOptions() and applyHomeOptions() read and write the element ids
home-sort-select / home-num-select / home-lang-select / home-label-select,
which no longer exist in the theme markup: the home view was migrated to the
shared #searchOptions drawer, so these ids are never rendered. Both functions
still run, but every getElementById returns null, so they have no effect.
resetOptionsDOM() also iterated the same non-existent home-*-select ids.

Remove both functions, the applyHomeOptions export and its call in app.js, the
renderHomeOptions call in renderSearchOptions, and the home-*-select loop in
resetOptionsDOM(). The home search-form submit still carries the keyword and
navigates, and clearSearchState() still resets the live drawer controls, so
behavior is unchanged.
… home select

test_searchJs_populatesHomeOptions asserted that search.js contains the literal
"home-sort-select", but no theme markup ever defined home-*-select elements — the
home view shares the #searchOptions drawer, and the helpers referencing those ids
were removed as no-ops. Update the test to assert what search.js actually does:
dynamically populate the shared label multi-select (#labelSearchOption) via
renderLabelOptions(). Renamed to test_searchJs_populatesLabelOption.
@marevol marevol self-assigned this Jun 22, 2026
@marevol marevol added the task label Jun 22, 2026
@marevol marevol added this to the 15.7.0 milestone Jun 22, 2026
@marevol marevol merged commit 49dcad5 into master Jun 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant