Skip to content

Replace chosen-js with selectWoo & remove chosen-js from Arches - #13062

Merged
samuelscandrett merged 25 commits into
dev/8.2.xfrom
sds/replace_chosen_with_select
Nov 5, 2026
Merged

samuelscandrett merged 25 commits into
dev/8.2.xfrom
sds/replace_chosen_with_select

Conversation

@samuelscandrett

@samuelscandrett samuelscandrett commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

As discussed in the issue below, chosen-js is unmaintained and inaccessible, so should be removed from Arches and where used should be replaced with selectWoo.

Issues Solved

Forms part of #13043 (doesn't close)
Also closes #9051 (as this was identified whilst testing and easily fixed)

Checklist

  • I targeted one of these branches:
    • dev/8.2.x (under development): features, bugfixes not covered below
    • dev/8.1.x (main support): regressions, crashing bugs, security issues, major bugs in new features
    • dev/7.6.x (extended support): major security issues, data loss issues
  • I added a changelog in arches/releases
  • I submitted a PR to arches-docs (if appropriate)
  • Unit tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • My test fails on the target branch

Accessibility Checklist

Developer Guide

Topic Changed Retested
Color contrast
Form fields
Headings
Links
Keyboard
Responsive Design
HTML validation
Screen reader

Accessibility has now improved, since chosen was not accessible.

Ticket Background

Further comments

Chosen was used across 34 templates. The dropdowns and those files were as follows. Each was tested with any additional actions noted:

Dropdown File Further actions after testing
Ontology graph-settings None
Root class graph-settings None
Branch root node datatype graph-settings None
Parent property/relationship node-form None
Ontology class node-form.htm None
Datatype node-form.htm None
Card Type card-configuration Creates new x and y scrollbars when opened
Widget Template widget-configuration Creates new x and y scrollbars when opened
Report Template graph-designer Creates new x and y scrollbars when opened
Graph switcher graph-designer None
"Set permissions for" permission-settings-form None
Graph switcher (function manager menu) function-manage-menu None
Buffer units buffer-editor Creates new x and y scrollbars when opened. Also is a different height to the units text field
Coordinate reference coordinate-editor A bit too wide now, could do with reducing width
Sibling cards grouping Creates new x and y scrollbars when opened
Related node node-value None
Edit type, resource model, node base-bulk-string-editor None
Resource model branch-excel-exporter  
Resource model tile-excel-exporter  
Resource model and nodegroup bulk-data-deletion None
Resource model and nodes bulk_edit_concept None
Target model, node mapping import-single-csv  
Name, description and map popup cards primary-descriptors None
Add-feature tool (enabled copy and disabled copy) iiif-annotation  
Add-feature tool (enabled copy and disabled copy) iiif-widget-annotation  
Add-feature tool map-editor None
Add-feature tool map-widget-editor Creates new x and y scrollbars when opened
Add-feature tool related-resources-map-editor Creates new x and y scrollbars when opened
Triggering nodegroups nodegroup-selector.htm Unable to test - is this still a feature supported by Arches 8.2?
Date Picker View Mode datepicker Creates new x and y scrollbars when opened
Find graph (Arches Designer) graph.htm None
Image nodes report-templates/image Creates new x and y scrollbars when opened
Tab icon & cards in tab report-templates/tabbed Creates new x and y scrollbars when opened
Find resource model resource This doesn't work, and hasn't since 6.0 (#9051)
Sort order edit-log None
Resource model; Language for label fallback migrate-to-reference-datatype None
Direction rich-text.htm  
Direction (data entry); Default direction (config) text.htm  None

@chrabyrd chrabyrd 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.

Overall looks good! just found a couple small things

<div>
<select data-bind="chosen: {width: '100%'}, value: graphId, options: resources, optionsText: 'name', optionsValue: 'graphid', optionsCaption: {% quoted_trans _("Select a resource...") %}, optionsAfterRender: setResourceOptionDisable"></select>
<select data-bind="
attr: {'data-label': {% quoted_trans _('Resource Model') %}},

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.

this announces the first option to screen readers instead of the placeholder. there's no value binding so the browser has the first option selected when SelectWoo builds the aria-label, and SelectWoo doesn't update it when select2Query clears the value. `

graphId` always starts null so on load this reads "Resource Model, Heritage Site" (or whatever's first) while "Select a resource..." is what's showing.

the ETL templates already handle this with value + valueAllowUnset, just needs the same here:

Suggested change
attr: {'data-label': {% quoted_trans _('Resource Model') %}},
attr: {'data-label': {% quoted_trans _('Resource Model') %}},
value: graphId,
valueAllowUnset: true,

<div class="col-xs-12 crm-selector">
<select class="design" data-bind="attr: {'disabled': graphSettingsViewModel.nodeCount() > 1 }, value: graph.ontology_id, valueAllowUnset: true, options: ontologies, optionsText: 'name', optionsValue:'ontologyid', optionsCaption: {% quoted_trans _("No ontology") %}, chosen: {disable_search_threshold: 10, width: '500px'}"></select>
<select class="design" data-bind="
attr: {'disabled': graphSettingsViewModel.nodeCount() > 1, 'data-label': {% quoted_trans _('Ontology') %}},

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.

same thing as resource.htm, a graph with no ontology reads "Ontology, CIDOC CRM" while showing "No ontology":

Suggested change
attr: {'disabled': graphSettingsViewModel.nodeCount() > 1, 'data-label': {% quoted_trans _('Ontology') %}},
attr: {'disabled': graphSettingsViewModel.nodeCount() > 1, 'data-label': {% quoted_trans _('Ontology') %}},
value: graph.ontology_id,
valueAllowUnset: true,

Comment thread releases/8.2.0.md Outdated
{% render_bundle 'bindings/chosen' %}
```

Also remove Chosen-js dependencies:

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.

this one 500s the landing page if it's left in, not just a 404. bindings/chosen isn't in webpack-stats anymore so render_bundle raises WebpackBundleLookupError. might be worth calling out since every project generated from the template has it

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.

I've improved the wording in 64bc544.

@chrabyrd chrabyrd 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.

looks good!

@phudson-he phudson-he 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.

Apart from what @chrabyrd found, I've not found any other issues

@chiatt chiatt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good. Just a couple of minor changes would be really nice.

  1. The nodegroup-selector.htm is no longer used. All four related files can be deleted. I realize it's a bit out of scope of this PR, but since you mention it in the description, could you go ahead and remove them?

arches/app/media/js/views/components/nodegroup-selector.js
arches/app/templates/views/components/nodegroup-selector.htm
arches/app/media/js/views/components/functions/local-file-storage.js
arches/app/templates/views/components/functions/local-file-storage.htm

  1. I don't see the new scrollbars. That issue might be isolated to Windows machines. I do see the wide width of the dropdowns in the map widget. Could you fix those? It seems pretty simple and it would be nice not to introduce that regression.

@samuelscandrett

samuelscandrett commented Nov 4, 2026 •

Copy link
Copy Markdown
Member Author

This looks good. Just a couple of minor changes would be really nice.

1. The nodegroup-selector.htm is no longer used. All four related files can be deleted. I realize it's a bit out of scope of this PR, but since you mention it in the description, could you go ahead and remove them?

arches/app/media/js/views/components/nodegroup-selector.js arches/app/templates/views/components/nodegroup-selector.htm arches/app/media/js/views/components/functions/local-file-storage.js arches/app/templates/views/components/functions/local-file-storage.htm

Files removed in 2c966ef.

2. I don't see the new scrollbars. That issue might be isolated to Windows machines. I do see the wide width of the dropdowns in the map widget. Could you fix those? It seems pretty simple and it would be nice not to introduce that regression.

Thanks for the spot on the map widget dropdowns - though the only one I see that's different is the Coordinate Reference dropdown (applied in 5103e8e)? Are there others @chiatt ?

As for the new scrollbars, see examples below:

map-widget-scrollbar.mp4
card-type-scrollbar.mp4

It only affects dropdowns which are within 600px of the right side of the screen (due to this select2 css) - anything left or central is unaffected.

In 7604610 I updated the css to ensure the inner select container box is given the width and max-width properties rather than the wrapper, and this seems to have fixed things.

@samuelscandrett
samuelscandrett force-pushed the sds/replace_chosen_with_select branch from 7604610 to ea8b4ba Compare November 4, 2026 15:42

@chiatt chiatt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm!

@samuelscandrett
samuelscandrett merged commit 7263f3f into dev/8.2.x Nov 5, 2026
5 of 13 checks passed
@github-project-automation github-project-automation Bot moved this to ✅ Done in pipeline Nov 5, 2026
@samuelscandrett
samuelscandrett deleted the sds/replace_chosen_with_select branch November 5, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Filterable dropdown not populated in Find tab on Resource Manager page

4 participants