forked from kevadesu/forgejo
fix(code search): various ui/ux improvements raised by user research (#4332)
various improvements from [user research](https://codeberg.org/forgejo/user-research/src/branch/main/interviews/2024-06/issues%28search%2Cfeatures%29%2Cselfhosting%2CCI%2Caccessibility%2Ccodesearch.md) - filenames are links to the respective files fixes: `fold menu: user clicked and expected to view file, instead the file collapsed` - refactor(searchfile.tmpl): ordered lists with lines grouped together instead of table fixes: `multiple matches per file are "merged", only visible in the code lines (no visual separation)` - feat: display fuzzy as "Either" when using git-grep which is much more accurate than "fuzzy" git-grep does not support fuzzy searching, in this context selecting fuzzy searching worked similar to an OR of white space separated keywords fixes: `typo doesn't bring results in fuzzy search` --- <details> <summary>Before</summary>  </details> <details> <summary>After</summary>  </details> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4332 Reviewed-by: 0ko <0ko@noreply.codeberg.org> Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com> Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
This commit is contained in:
parent
2d85d51879
commit
928f188689
7 changed files with 88 additions and 24 deletions
|
@ -26,7 +26,10 @@
|
|||
- {{.Filename}}
|
||||
</span>
|
||||
{{else}}
|
||||
<span class="file tw-flex-1 tw-ml-2">{{.Filename}}</span>
|
||||
<span class="file tw-flex-1 tw-ml-2">
|
||||
<a rel="nofollow" class="muted file-link" href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{.Filename | PathEscapeSegments}}">{{/*
|
||||
*/}}{{.Filename}}</a>
|
||||
</span>
|
||||
{{end}}
|
||||
<a role="button" class="ui basic tiny button" rel="nofollow" href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{.Filename | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
|
||||
</h4>
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<form class="ui form ignore-dirty">
|
||||
{{template "shared/search/combo_fuzzy" dict "Value" .Keyword "Disabled" .CodeIndexerUnavailable "IsFuzzy" .IsFuzzy "Placeholder" (ctx.Locale.Tr "search.code_kind")}}
|
||||
{{template "shared/search/combo_fuzzy"
|
||||
dict
|
||||
"Value" .Keyword
|
||||
"Disabled" .CodeIndexerUnavailable
|
||||
"IsFuzzy" .IsFuzzy
|
||||
"Placeholder" (ctx.Locale.Tr "search.code_kind")
|
||||
"CodeIndexerDisabled" $.CodeIndexerDisabled}}
|
||||
</form>
|
||||
<div class="divider"></div>
|
||||
<div class="ui user list">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue