Skip to content

Additional solr updates - #189

Merged
tisto merged 12 commits into
mainfrom
additional-solr-updates
Sep 20, 2025
Merged

Additional solr updates#189
tisto merged 12 commits into
mainfrom
additional-solr-updates

Conversation

@reekitconcept

@reekitconcept reekitconcept commented Aug 27, 2025

Copy link
Copy Markdown
Member
  • update kitconcept.solr to 2.0.0-a2, 2.0.0-alpha.2
  • search result style changes
    • hide builtin search input
    • keep search term after being submitted
    • make search result page full width
    • highlight searchbox on hover and focus
  • necessary updates on solrSearchAutosuggest
    • wire the search widget in the header
  • make search keep current state (ie. sorting by, etc.)

@reekitconcept
reekitconcept requested a review from a team as a code owner August 27, 2025 11:58
@reekitconcept

reekitconcept commented Aug 27, 2025

Copy link
Copy Markdown
Member Author

UPDATE: what I write in the comment below is not needed any more.

To try this out, you manually have to switch kitconcept.solr to the additional-solr-updates branch, and make sure python installs this branch.

It is unknown if this can be done in a better way with uv. The way I did it is I checked out the branch somewhere, then manually added this to pyproject.yaml. Then build the backend with this. The path has to be the location where you checked out kitconcept.solr locally. I don't know any way how this could be checked in currently.

[project]
...
dependencies = [

   ...

    "kitconcept.solr @ /Users/ree/work/kitconcept/solr/kitconcept.solr/backend",
]

@reekitconcept
reekitconcept requested review from tisto and removed request for a team August 27, 2025 15:12
@tisto

tisto commented Aug 27, 2025

Copy link
Copy Markdown
Member

@reekitconcept I get an error when I run "make" after doing the amendments you specified:

kitconcept.intranet git:(additional-solr-updates) ✗ make
Install Backend & Frontend
==> Sync project dependencies
error: Failed to generate package metadata for `kitconcept-intranet @ editable+.`
  Caused by: The build backend returned an error
  Caused by: Call to `hatchling.build.prepare_metadata_for_build_editable` failed (exit status: 1)

[stderr]
Traceback (most recent call last):
  File "<string>", line 14, in <module>
  File "/Users/timo/.cache/uv/builds-v0/.tmpZBj31m/lib/python3.12/site-packages/hatchling/build.py", line 142, in prepare_metadata_for_build_editable
    f.write(builder.config.core_metadata_constructor(builder.metadata, extra_dependencies=extra_dependencies))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/timo/.cache/uv/builds-v0/.tmpZBj31m/lib/python3.12/site-packages/hatchling/metadata/spec.py", line 574, in construct_metadata_file_2_4
    if metadata.core.dependencies:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/timo/.cache/uv/builds-v0/.tmpZBj31m/lib/python3.12/site-packages/hatchling/metadata/core.py", line 1220, in dependencies
    self._dependencies = list(self.dependencies_complex)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/timo/.cache/uv/builds-v0/.tmpZBj31m/lib/python3.12/site-packages/hatchling/metadata/core.py", line 1205, in dependencies_complex
    raise ValueError(message)
ValueError: Dependency #11 of field `project.dependencies` cannot be a direct reference unless field `tool.hatch.metadata.allow-direct-references` is set to `true`

hint: This usually indicates a problem with the package or the build environment.
make[2]: *** [sync] Error 2
make[1]: *** [backend-install] Error 2
make: *** [install] Error 2

I had to add this to pyproject.toml:

[tool.hatch.metadata]
allow-direct-references = true

@reekitconcept
reekitconcept requested a review from a team as a code owner August 28, 2025 11:47
@reekitconcept

Copy link
Copy Markdown
Member Author

To try this out, you manually have to switch kitconcept.solr to the additional-solr-updates branch, and make sure python installs this branch.

It is unknown if this can be done in a better way with uv. The way I did it is I checked out the branch somewhere, then manually added this to pyproject.yaml. Then build the backend with this. The path has to be the location where you checked out kitconcept.solr locally. I don't know any way how this could be checked in currently.

[project]
...
dependencies = [

   ...

    "kitconcept.solr @ /Users/ree/work/kitconcept/solr/kitconcept.solr/backend",
]

Update, I found a way to do this from the config, so you don't need any of the above any more. It won't give you a checkout that you can develop locally though, so if you need local development on the dependent package (in this case kitconcept.solr) you still need to check it out manually and add the dependency override I described above. However for running the app locally or on servers, this isn't needed now.

@reekitconcept

Copy link
Copy Markdown
Member Author

I had to add this to pyproject.toml:

[tool.hatch.metadata]
allow-direct-references = true

Sorry, I forgot to mention this.

On the bright side, I figured out how to do this without the need to any edit, and added that as a new commit. It also contains the hatch change.

@reekitconcept
reekitconcept force-pushed the additional-solr-updates branch from 604ebd1 to f5c1f30 Compare September 5, 2025 13:24
@reekitconcept reekitconcept changed the title WIP Additional solr updates Additional solr updates Sep 5, 2025
@reekitconcept
reekitconcept force-pushed the additional-solr-updates branch from 459c7d8 to 815f594 Compare September 9, 2025 08:22
- update kitconcept.solr to 2.0.0-a2, 2.0.0-alpha.2
- search result style changes
  - hide builtin search input
  - keep search term after being submitted
  - make search result page full width
  - highlight searchbox on hover and focus
- necessary updates on solrSearchAutosuggest
  - wire the search widget in the header
- make search keep current state (ie. sorting by, etc.)

Also:

- fix test that checks restapi version, now 9.15.2
@reekitconcept
reekitconcept force-pushed the additional-solr-updates branch from 815f594 to 4f3715d Compare September 9, 2025 11:13
Comment thread frontend/packages/volto-intranet/package.json
@tisto

tisto commented Sep 19, 2025

Copy link
Copy Markdown
Member

@ericof can we merge this PR now or is anything holding us back?

@ericof

ericof commented Sep 19, 2025

Copy link
Copy Markdown
Contributor

Yes, we can.

"dependencies": {
"@kitconcept/core": "workspace:*",
"@kitconcept/volto-solr": "2.0.0-alpha.1",
"@kitconcept/volto-solr": "2.0.0-alpha.2",

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.

@ericof this commit made all a11y tests fail. I have no clue why this happens.

@davisagli davisagli Sep 19, 2025

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.

@tisto This is the rule that is failing: "Ensures every ARIA input field has an accessible name (aria-input-field-name)"

I guess it is something wrong with the autocomplete livesearch input from kitconcept/kitconcept.solr#43 since that appears in the header of every page

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.

@ericof this commit made all a11y tests fail. I have no clue why this happens.

This is the latest released version of @kitconcept/volto-solr. We need to fix the issue there :-(

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.

@davisagli right. Good catch. The good thing is that it means we fetch the correct code and functionality. Then someone needs to look at how we can fix these a11y regressions.

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.

Screenshot 2025-09-19 at 3 42 07 PM

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.

@davisagli davisagli Sep 19, 2025

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.

@tisto @ericof I fixed a conditional (4bb41fb) so that it won't try to use the autosuggest search widget when solr is not active. That should be enough to make the a11y tests pass. We still need to follow up in kitconcept.solr and fix the issue so that the aria-label is there when it is enabled. But at least this way we won't cause a regression for sites that aren't using solr.

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.

I also added an issue: kitconcept/kitconcept.solr#47

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.

Awesome! Thanks a lot, David!

@tisto
tisto merged commit 0336fe3 into main Sep 20, 2025
25 checks passed
@tisto
tisto deleted the additional-solr-updates branch September 20, 2025 06:38
@@ -1,4 +1,5 @@
import type { ConfigType } from '@plone/registry';
import './theme/custom.scss';

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.

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.

5 participants