Port file tree sidebar and keyboard shortcuts from Gitea #1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Feature request
Port the file tree sidebar and keyboard shortcuts that Gitea has added since the hard fork.
1. File Tree Sidebar (when viewing source files)
Gitea added a toggleable file tree sidebar that appears when viewing a file. It shows the full directory tree alongside the code, replacing the need for the
tfuzzy finder in many workflows.Gitea implementation files:
web_src/js/features/repo-view-file-tree.tsweb_src/js/features/repo-diff-filetree.tsweb_src/js/features/repo-findfile.tsthotkey — also worth porting)templates/repo/view_file_tree.tmpltemplates/repo/view_file_tree_toggle_button.tmplHow it works:
repo-view-file-tree-toggle) shows/hides the sidebarViewFileTree.vue) that renders the directory treePOST /user/settings/update_preferenceswithcodeViewShowFileTree/tree-listendpoint (which Forgejo already has!)Key commits to look at in Gitea repo:
repo-view-file-treein Gitea commit history2. Keyboard Shortcuts
Gitea has global keyboard shortcuts that work on any repo page.
Gitea implementation files:
web_src/js/modules/shortcut.ts<kbd>hints)templates/devtest/keyboard-shortcut.tmplweb_src/css/modules/shortcut.cssHow it works:
<kbd>elements next to<input>fields declare shortcutsdata-shortcut-keysattribute specifies the keyglobal-shortcut-wrapperCSS class marks shortcut-enabled inputsWhy this matters
Forgejo was a soft fork of Gitea and the codebases are both Go with Vue frontends. The file tree sidebar and keyboard shortcuts are self-contained features that should be straightforward to port — the backend endpoints (
/tree-list,/find) already exist in Forgejo.These are the two most noticeable UX gaps when switching from Gitea to Forgejo.
References
forgejo)Merged via squash in PR #2. 17 files, 129 tests pass.