Cláudio Silva (claudioantonio) opened
When a user have more than one repository would be interesting to know in which repository He is connected to. This can avoid actions in the wrong repo.

Labels: area/ui/web lifecycle/rotten
Cláudio Silva (claudioantonio) opened
When a user have more than one repository would be interesting to know in which repository He is connected to. This can avoid actions in the wrong repo.

Cláudio Silva (claudioantonio)
added label
area/ui/web
Michael Muré (MichaelMure) commented
I suppose this should be hidden if we only have the (unnamed) default repository.
Sascha (GlancingMind) commented
I have a question. Can one git-bug instance already manage multiple repositories? I thought that I have to run multiple instances per repository. If this is currently not possible, maybe doing the same as gopass - multi stores, might be an option (for future reference).
Michael Muré (MichaelMure) commented
The core and the GraphQL API support it, but there is no tooling (CLI, config file ...) around to actually register multiple repo.
See https://github.com/MichaelMure/git-bug/blob/master/cache/multi_repo_cache.go#L23 : nothing is calling this function.
https://github.com/MichaelMure/git-bug/blob/master/api/graphql/schema/root.graphql#L2-L3 : you can query another repo if you have one.
Michael Muré (MichaelMure) changed the title from
WebUI - show the name for the browsed repository to WebUI - show the name for the browsed repository
Michael Muré (MichaelMure)
added label
Easy pick
github-actions (github-actions) commented
This bot triages untriaged issues and PRs according to the following rules:
lifecycle/stale label is appliedlifecycle/stale was applied, the issue is closedTo remove the stale status, you can:
lifecycle/stale label
github-actions (github-actions)
added label
lifecycle/stale
sudoforge removed label Easy pick
github-actions (github-actions) commented
This bot triages issues in order to help the maintainers identify what needs attention, according to the following lifecycle rules:
lifecycle/stale is appliedlifecycle/stale was applied,
lifecycle/rotten is appliedThis bot will not automatically close stale issues.
To remove the stale status, you can:
To avoid automatic lifecycle management of this issue, add
lifecycle/frozen.
github-actions (github-actions)
added label
lifecycle/rotten
github-actions (github-actions)
removed label
lifecycle/stale
sudoforge removed label lifecycle/dormant
Jonathan Raphaelson (lygaret) commented
@sudoforge, digging into this a bit I have a suggestion:
__default, we display it in the app bargit-bug.repo-name config if it's present, as a way to short-circuit not having a way to name it
screenshot manually hacked together with devtools, but it's the general idea
Jonathan Raphaelson (lygaret) commented
(also shows where the tabbed-nav would move, getting rid of the "coming soon" links)
sudoforge commented
if there's a repo name that's not the default __default, we display it in the app bar
the current value of the "repo name" will always be __default, though, due to the current implementation of the cache.
in the repo cache, [where we set the name by default][1], we update it to pull a git-bug.repo-name config if it's present, as a way to short-circuit not having a way to name it
i think i'd rather refactor the way we determine the repository name. repositories have a few different names:
origin, this is likely a better source for deriving the repository name, but it gets tricky when you consider that (1) remote names are arbitrary and (2) you can have any number of remotes in a git repositoryso, taking that into consideration, i think defaulting the name of the repository to the basename of the directory the repository lives in makes a lot more sense than __default.
that said, in the current implementation of the multi repo cache, that could result in potential conflicts (e.g. two repositories on disk: /code/a/foo and /code/b/foo), so this "name" (at least internally, as it is represented in the cache) really needs to be a unique identifier. something like the checksum of the full path might work.
i'm undecided on whether or not the repository name should be a user-configurable attribute. i think i'm leaning towards "no", especially if we are deriving the name in this manner.
future ticket can allow rename from within UI, and change the name to a dropdown component if we want to handle multiples
given the above, i'm leaning towards disagreeing with sourcing the name of the repo from the git configuration, and thus, renaming isn't a thing that should be supported. maybe "moving" it can be, though (which would actually move it on disk)?
sudoforge commented
(so, the feature could be implemented today by just showing the value you're getting back from the API, but not rendering anything if the value is __default)
sudoforge commented
okay, after thinking about this for a few more seconds, maybe the name should be independent from the thing that's stored in the cache, e.g. git-bug.cache-id and git-bug.repo-name
Michael Muré (MichaelMure) commented
the feature could be implemented today by just showing the value you're getting back from the API, but not rendering anything if the value is __default
This is the way. How the repo is named is not a concern of the webUI, it should just use whatever the graphQL API says.
Those names will come from logic in the webui command, which can be implemented however we want.
Jonathan Raphaelson (lygaret) commented (edited)
Yep, that's great; the webui change does exactly this, hiding if the name isn't __default - I will avoid any backend changes to default or pull anything new. I do think that defaulting to the directories base name when first run would be a good idea, if only because it'd let there be something in the header other than the logo
This is what I've currently got, and I'm curious what you'd like me to move with (the ones with a name showing are for testing styling, __default would never show):
sudoforge commented
i think i'm of the opinion that if there's a repo name, it should replace git-bug in the header. as-is, it's a little visually confusing, as it bleeds into the navigation links.
somewhat related, i also think that we shouldn't have any navigation link at all, since "bugs" is the only view.
Jonathan Raphaelson (lygaret) commented
Easy enough, I think that all makes sense; I'll have two related PRs up shortly; the react 19 + router upgrade, and this (since I forgot to cut this before the upgrade lol)
sudoforge commented
you could just cherry-pick it:
git fetch
git checkout origin/HEAD
git cherry-pick <commit>
git push origin HEAD:refs/heads/my-branch-name
sudoforge commented
er, well, whatever you've named the remote.