Skip to content

Add project column picker to issue and pull request sidebar#37037

Open
myers wants to merge 21 commits intogo-gitea:mainfrom
myers:feat/issue-column-picker
Open

Add project column picker to issue and pull request sidebar#37037
myers wants to merge 21 commits intogo-gitea:mainfrom
myers:feat/issue-column-picker

Conversation

@myers
Copy link
Copy Markdown
Contributor

@myers myers commented Mar 29, 2026

Why? You are working on a ticket, it's ready to be moved to the QA column in your project. Currently you have to go to the project, find the issue card, then move it. With this change you can move the issue's column on the issue page.

When an issue or pull request belongs to a project board, a dropdown appears in the sidebar to move it between columns without opening the board view. Read-only users see the current column name instead.

This was written using Claude Code and Opus.

Closed:

image

Open:
image

When an issue or pull request belongs to a project board, a dropdown
appears in the sidebar to move it between columns without opening the
board view. Read-only users see the current column name instead.

The dropdown uses Fomantic UI and updates the column via an AJAX POST,
re-rendering the selector in place on success.
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 29, 2026
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/frontend labels Mar 29, 2026
Copy link
Copy Markdown
Member

@bircni bircni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't feel consistent and good

@wxiaoguang
Copy link
Copy Markdown
Contributor

wxiaoguang commented Mar 29, 2026

  1. I don't see why you need to re-invent the wheel. The existing combo list just works well, you can see there are other "pickers" like "milestone"
    • To "re-render", it should use a framework-level support (refactor the framework to support re-rendering the selector in place for all pickers), but not write a renderColumnPicker-like function for every picker.
  2. It comes to the same situation like Add project column choice option on issue sidebar #30617 (comment)

@wxiaoguang wxiaoguang marked this pull request as draft March 29, 2026 22:59
myers added 2 commits March 29, 2026 23:38
Address review feedback from bircni and wxiaoguang:

- Add rerender(items, selectedValue) method to IssueSidebarComboList
  so any picker can dynamically rebuild its menu. This replaces the
  one-off renderColumnPicker function with a framework-level capability.

- Convert the column picker template to use the standard
  issue-sidebar-combo structure, so it is initialized by the existing
  queryElems loop alongside milestone/label/assignee pickers.

- Move projectColumnInfo struct to package level (bircni)
- Handle ProjectColumnID and MustDefaultColumn errors (bircni)
- Remove custom Fomantic dropdown setup and DOM manipulation

The rerender method is designed to support future multi-project use:
each project's column picker can independently rerender when its
parent project selection changes.
All sidebar pickers (labels, milestone, project, column) previously
discarded backend errors silently. Now shows a toast notification
on HTTP errors or network failures.
@myers
Copy link
Copy Markdown
Contributor Author

myers commented Mar 29, 2026

  1. I don't see why you need to re-invent the wheel. The existing combo list just works well, you can see there are other "pickers" like "milestone"

Got it, will extend the combo box even if this makes the impact radius bigger.

   * To "re-render", it should use a framework-level support (refactor the framework to support re-rendering the selector in place for all pickers), but not write a `renderColumnPicker`-like function for every picker.

Same.

2. It comes to the same situation like  [Add project column choice option on issue sidebar #30617 (comment)](https://github.com/go-gitea/gitea/pull/30617#issuecomment-2816668521)

The other PR is closed and tangled up in multiple projects per issue. I just want to do a single Kanban project for my repos and be able to move the column it is on from the issue page. Will you accept this PR if it only addresses single project needs?

myers added 3 commits March 29, 2026 23:48
Tests the full workflow: create project with Basic Kanban template,
assign issue to project, verify column picker appears, select a
different column, reload and verify it persisted.
The gear-icon header pattern (fixed-text muted) is designed for
top-level sidebar sections like Labels/Milestone/Assignees. The
column picker is a secondary control under the project selection,
so it should look like a form select — bordered box showing the
current value with a dropdown arrow.

Restores the ui dropdown selection fluid style from the original
implementation while keeping the issue-sidebar-combo wrapper for
the rerender capability.
Integration tests for UpdateIssueProjectColumn endpoint:
- MoveToColumn: verify column change persists
- InvalidColumn: reject column from wrong project (404)
- NonexistentColumn: reject missing column (404)
- IssueFromOtherRepo: reject cross-repo issue (404)

E2E test improvements:
- Assert dropdown closes after selection
- Assert sidebar shows new column name
- Assert timeline event appears for column move
- Use specific selector for reload verification
@myers
Copy link
Copy Markdown
Contributor Author

myers commented Mar 30, 2026

@wxiaoguang I think this is worth another look.

@myers myers marked this pull request as ready for review March 30, 2026 03:39
@myers
Copy link
Copy Markdown
Contributor Author

myers commented Mar 30, 2026

I think this would close #13520

@wxiaoguang
Copy link
Copy Markdown
Contributor

I have some ideas to simplify the code, will take a try later.

@wxiaoguang wxiaoguang self-assigned this Mar 30, 2026
data.retrieveProjectColumnsData(ctx)
if ctx.Written() {
return data
}
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.

The comment and code was added to wrong place.

{{end}}
{{end}}
{{end}}
{{end}}
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.

Don't write code without indent, it is unmaintainable.

image

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Mar 30, 2026

Not sure I like this full-size dropdown UI, it looks strange. Maybe change it to a simple SVG icon besides the project, with dropdown menu attached. Does GitHub offer similar functionality?

Also this will almost certainly conflict with #36784.

@wxiaoguang
Copy link
Copy Markdown
Contributor

wxiaoguang commented Mar 30, 2026

Also this will almost certainly conflict with #36784.

Already considered about that, prepared for it:

Details image

@wxiaoguang wxiaoguang marked this pull request as draft March 30, 2026 12:19
@wxiaoguang wxiaoguang removed their assignment Mar 30, 2026
@wxiaoguang wxiaoguang marked this pull request as ready for review March 30, 2026 14:41
@silverwind
Copy link
Copy Markdown
Member

how is the UI now? Still a fat <input>-style dropdown or something better?

@wxiaoguang
Copy link
Copy Markdown
Contributor

wxiaoguang commented Mar 30, 2026

(Just writing the comment)

My concerns were all addressed. Especially that we have a clear partial-reloading approach. It should bring better user experiences. And it won't really block "Multiple projects" feature.

The remaining TODOs:

  1. The dropdown UI fine tuning (it doesn't bother me, good-looking or not, there are always chances to improve)
  2. Tests: need to rewrite, the code has changed a lot.

@wxiaoguang
Copy link
Copy Markdown
Contributor

how is the UI now? Still a fat <input>-style dropdown or something better?

Removed the "fat" style

image

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Mar 30, 2026

those 2 rows still refer to the same project, right? Can we just make a small "cog" or similar item that opens a menu (probably with tippy)? I would prefer 1 project per row.

@wxiaoguang
Copy link
Copy Markdown
Contributor

those 2 rows still refer to the same project, right? Can we just make a small "cog" or similar item that opens a menu (probably with tippy)? I would prefer 1 project per row.

First is project, second is column. No idea what you ask for.

@silverwind
Copy link
Copy Markdown
Member

I'm wondering how it would look with multiple projects:

  • Proj1
  • Col1
  • Proj2
  • Col1

That would be a confusing display. Better would be:

  • Proj1 / Col1
  • Proj2 / Col2

@wxiaoguang
Copy link
Copy Markdown
Contributor

wxiaoguang commented Mar 30, 2026

I'm wondering how it would look with multiple projects:

It doesn't support. Leave the problem to the future.

image

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Mar 30, 2026

IDK about this feature. It's a confusing display for what I think is a rather pointless feature and increase of visual complexity. GitHub does not support this afaik and I think they may have good reason to not bloat the UI with this column display.

A issue is part of a project, that's enough info that I need, if I need more, I go to the project.

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Mar 30, 2026

Maybe future multi-project could display

Proj1
Col1
---
Proj2
Col1

But I'm still not quite sold on this display. The header says "Projects" and list tow rows which instinctively makes me think its two projects while it is 1. I think column needs more visual distinction, like lighter and/or smaller text.

@wxiaoguang
Copy link
Copy Markdown
Contributor

I extracted my code to Refactor issue sidebar #37045, it doesn't display the "project column" on sidebar

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Mar 30, 2026

"Projects" header here from your last screenshots. It implies that projects follow but actually projects and columns follow:

image

1 line per project would be a ideal display imho, not sure how to solve given the limited space.

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
@metiftikci
Copy link
Copy Markdown
Member

metiftikci commented Mar 31, 2026

Just want to put another option :)

image

@myers
Copy link
Copy Markdown
Contributor Author

myers commented Mar 31, 2026

I did some research of how projects look on github:

Screenshot 2026-03-30 at 12 50 43 PM

Two projects, you can see how they brought the project column color into it.

Screenshot 2026-03-30 at 12 50 55 PM

Here's what the column picker looks like when opened

Screenshot 2026-03-30 at 12 51 04 PM

I don't think we should do any of this, but this is how the custom metadata for project cards (which gitea does not have) is visible, and can be edited.

It seems like the request here is to think about multi-project support. What do you think of how github looks and works?

If this PR is merged I'm happy to add this to the multi-project PR.

@bircni
Copy link
Copy Markdown
Member

bircni commented Mar 31, 2026

I don't really like this its not that easy to understand what it refers to and what I can do with it
Bildschirmfoto 2026-03-31 um 14 32 40

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Mar 31, 2026

A per-project box like GitHub has would be ideal. It provides the needed visual grouping. Shouldn't be too hard to implement. At minimum I'd like a border around each project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Show project's board in issue view

6 participants