Skip to content

results are heavily truncated on mobile devices #2864

Description

@brc-dd

Description

See vuejs/vitepress#5126

Steps to reproduce

  1. Go to https://vitepress.dev/
  2. Click on the search button
  3. Resize the browser to mobile viewports
  4. Search for layout slots

It shows like this even though there is significant space:

Image

The API response is like this:

"_snippetResult": {
  "content": {
    "value": "… the theme via <mark>layout</mark> <mark>slots</mark>.",
    "matchLevel": "full"
  },
  "hierarchy": {
    "lvl1": {
      "value": "Extending the Default Theme ​",
      "matchLevel": "none"
    }
  }
}

It seems to be reproducible on DocSearch's official website too. For example:

Image

Expected behavior

The server-side truncation should consider the element width, or maybe do the truncation on client side entirely?

Environment

  • OS: macOS 26.3
  • Browser: Chromium 145.0.7632.110
  • DocSearch version: 4.5.3

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions