scambier / obsidian-omnisearch

A search engine that "just works" for Obsidian. Supports OCR and PDF indexing.
GNU General Public License v3.0
1.25k stars 65 forks source link

[Feature request] Search results are displayed in a more readable way like this #393

Closed jiajiala closed 2 months ago

jiajiala commented 2 months ago

Is your feature request related to a problem? Please describe. The amount of information I get every time I search makes it difficult to find what I want to focus on in the first place So hopefully the search results will be more readable Changes like this image Put the path to the file after the file, and use a flashback structure In this way, the file will be seen first, and then the folder it is in will be seen, and then the full path it is in will be noticed, up to the top folder. If the path is too long, the top folder will be omitted instead of the folder it is in

I have tried to use css to achieve this effect, but my ability is limited and I can't find a way to achieve it. I hope you can help me And I think if more users can use this design, it will definitely help them

Thanks again for making this plugin

scambier commented 2 months ago

I'm not sure it's possible to insert the folder between the filename and the number of matches without changing the html.

But this snippet will put the filename and the folder on the same line

.suggestion-item .omnisearch-result {
    width: 100%;
}

div:has(> .omnisearch-result__title-container) {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; /* or flex-start */
}

.omnisearch-result__folder-path {
    margin-left: 1em;
}

div:has(> .omnisearch-result__body) {
    display: flex;
    flex: 1 1 100%;
}

.omnisearch-result__body {
    flex: 1 1 100%;
}
jiajiala commented 2 months ago

@scambier image Not sure how to remove these two ICONS They mean nothing to me and make the search confusing

scambier commented 2 months ago
.omnisearch-result svg {
    display: none;
}