Refactor issue sidebar and fix various problems#37045
Refactor issue sidebar and fix various problems#37045wxiaoguang merged 12 commits intogo-gitea:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the issue sidebar to support partial page reloading (avoiding full-page reloads that can lose in-progress edits) and fixes legacy project/column edge cases (not creating a default column when viewing an empty project).
Changes:
- Convert issue sidebar initialization to a
data-global-init/observer-driven approach so newly inserted sidebar DOM can be re-initialized automatically. - Replace sidebar-triggered full page reloads with a “partial reload” that swaps the sidebar and appends new timeline items.
- Adjust project selection/meta handling to support “multiple projects” groundwork and avoid creating default columns for empty projects.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| web_src/js/features/repo-issue.ts | Ensures sidebar init is registered even when comment form isn’t present. |
| web_src/js/features/repo-issue-sidebar.ts | Refactors sidebar init to global-init + sidebar-scoped DOM querying. |
| web_src/js/features/repo-issue-sidebar-combolist.ts | Implements partial reload logic after sidebar updates (GET + DOM replacement). |
| templates/repo/issue/view_content/sidebar.tmpl | Adds data-global-init hook to sidebar container. |
| templates/repo/issue/new_form.tmpl | Adds data-global-init hook to sidebar on new issue/PR form. |
| templates/repo/issue/sidebar/project_list.tmpl | Switches hidden value source to SelectedProjectIDs (multi-project groundwork). |
| routers/web/repo/issue_page_meta.go | Adds project meta retrieval and multi-project fields on page metadata. |
| routers/web/repo/issue_new.go | Parses project as a comma-separated list; adapts metadata accordingly. |
| models/project/column.go | Adds GetDefaultColumnWithFallback and refactors default-column logic. |
| services/projects/issue.go | Uses fallback default-column retrieval; returns empty results for projects with no columns. |
| models/issues/issue_project.go | Removes unused LoadIssuesFromColumn helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
How about also removing the branch/tag selector as previously discussed? |
No, not in this PR's scope, and there are still users saying "they really need it", although I doubt. |
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
2c1b6ea to
ed2ee41
Compare
ed2ee41 to
857a02c
Compare
|
@lunny did you check the fix. i still got the same problem btw sorry for missed that |
I have checked, the problem is fixed. How do you build your frontend assets? IIRC the new vite dev server's assets sometimes is still cached on browser side. Maybe you need to refresh to try. |
Yes, I checked it. I tested it using |
What's your browser? If you don't change label, will there be the same problem? |
|
Also cc @yardenshoham do you know how to debug the problem? TBH I have no idea ..... |
|
Should just remove HTMX before touching any more functionalities it touches. I can probably task Claude on it later, should be a pretty safe refactor if e2e tests are used to cover the functionality during the migration. |
According to your screenshot, I guess you are using Edge. Also tried, still not able to reproduce. |
|
Since this PR is already large enough, and the "sidebar operation -> subscribe -> incorrect page" issue can't be reproduced by others, I think we can merge this as is, and let more people to help to test and figure out the root problem.
|
* main: Refactor issue sidebar and fix various problems (go-gitea#37045) Add tests for pull request's content_version in API (go-gitea#37044) Enable concurrent vitest execution (go-gitea#36998) Fix theme discovery and Vite dev server in dev mode (go-gitea#37033) bump snapcraft deps (go-gitea#37039) Expose content_version for optimistic locking on issue and PR edits (go-gitea#37035)
|
FYI tested main with clean build on new codespace and can not see the problem |
* origin/main: (192 commits) Fix NuGet package upload error handling (go-gitea#37074) Desaturate dark theme background colors (go-gitea#37056) Update JS dependencies and misc tweaks (go-gitea#37064) Redirect to the only OAuth2 provider when no other login methods and fix various problems (go-gitea#36901) Show workflow link (go-gitea#37070) Remove leftover `webpackChunkName` comments from codeeditor (go-gitea#37062) Update Go dependencies (go-gitea#36781) Add webhook name field to improve webhook identification (go-gitea#37025) (go-gitea#37040) Upgrade `go-git` to v5.17.2 (go-gitea#37060) Replace Monaco with CodeMirror (go-gitea#36764) Update Combine method to treat warnings as failures and adjust tests (go-gitea#37048) Raise minimum Node.js version to 22.18.0 (go-gitea#37058) Update golangci-lint to v2.11.4 (go-gitea#37059) Upgrade `golang.org/x/image` to v0.38.0 (go-gitea#37054) Increase e2e test timeouts on CI to fix flaky tests (go-gitea#37053) Refactor "org teams" page and help new users to "add member" to an org (go-gitea#37051) Refactor issue sidebar and fix various problems (go-gitea#37045) Add tests for pull request's content_version in API (go-gitea#37044) Enable concurrent vitest execution (go-gitea#36998) Fix theme discovery and Vite dev server in dev mode (go-gitea#37033) ... # Conflicts: # templates/user/dashboard/feeds.tmpl


Fix various legacy problems, including:
The sidebar refactoring: it is a clear partial-reloading approach, brings better user experiences, and it makes "Multiple projects" / "Project column on issue sidebar" feature easy to be added.