Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

Standardize filter rows and add tag selection to the code page

55615c7a4b8472f8bfccab8048f608978d389821 · Keenan Nemetz · 11d ago · parent 3a068983

Standardize filter rows and add tag selection to the code page

The code page kept its branch picker in the header actions, had no tag picker,
and left every list page to shape its own filters: search inputs ranged from
10rem to 18rem, some selects had a visible label and some did not, and text
searches submitted through a Filter button, a Search button, or Enter alone
while selects sometimes waited for a click.

- One .filters row on issues, requests, activity, the code page and code
  search. One --search-w (18rem) for page and global search, a visible label on
  every filter select, auto-apply on select change, and one icon-and-Search
  button for text.
- The code page puts its search, branch picker and new tag picker on the shared
  row under the header. The tag picker lists tags newest first and leaves the
  branch picker unclaimed when a tag is open.
- data-autosubmit uses requestSubmit() so htmx swaps the filtered pane instead
  of a full page load.

Checks: ./vole workflow check; ./vole workflow run verify.

server/web/codebrowser.go +23−2

@@ -33,6 +33,9 @@ type codeView struct {
33 33 Commit string
34 34 Count int
35 35 Branches []string
36 Tags []string
37 OnBranch bool // ref names a branch, so the branch picker shows it
38 OnTag bool // ref names a tag, so the tag picker shows it
36 39 Latest []git.Commit
37 40 Tree []*treeNode
38 41 TreeTruncated bool
@@ -98,8 +101,9 @@ func (w *Web) Code(rw http.ResponseWriter, r *http.Request) {
98 101 }
99 102
100 103 // codeShell gathers everything the full code page keeps outside the main pane:
101 // the branch list, the file tree, the latest commit, and contributor-branch
102 // state. HTMX fragment requests skip the work they will not render.
104 // the branch and tag lists, the file tree, the latest commit, and
105 // contributor-branch state. HTMX fragment requests skip the work they will not
106 // render.
103 107 func (w *Web) codeShell(r *http.Request, m *repo.Meta, ref, commit, active string, full bool) codeView {
104 108 g := m.Git()
105 109 v := codeView{
@@ -123,6 +127,23 @@ func (w *Web) codeShell(r *http.Request, m *repo.Meta, ref, commit, active strin
123 127 }
124 128 sort.Strings(names)
125 129 v.Branches = names
130 for _, name := range names {
131 if name == ref {
132 v.OnBranch = true
133 break
134 }
135 }
136 // Tags share the ref picker's target: a tag names a commit, so browsing a
137 // tag is the same page as browsing a branch.
138 if tags, err := g.Tags(); err == nil {
139 v.Tags = make([]string, 0, len(tags))
140 for _, tag := range tags {
141 v.Tags = append(v.Tags, tag.Name)
142 if tag.Name == ref {
143 v.OnTag = true
144 }
145 }
146 }
126 147 return v
127 148 }
128 149