Allow navigating from issue to repo #937

Merged
6543 merged 7 commits from qwerty287/GitNex:issue-to-repo into main 2 weeks ago

Describe what your pull request does and which issue you’re targeting

This is ready to review/merge

Closes #747


### Describe what your pull request does and which issue you’re targeting <!-- Create a new issue, if it doesn't exist yet --> This is ready to review/merge Closes #747 <br><br> <!-- Make sure you are targeting the "main" branch, pull requests on release branches are only allowed for bug fixes. --> - [X] I carefully read the [contribution guidelines](https://codeberg.org/GitNex/GitNex/src/branch/main/CONTRIBUTING.md). - [X] I'm following the code standards as defined [here](https://codeberg.org/gitnex/GitNex/wiki/Code-Standards). - [X] By submitting this pull request, I permit GitNex to license my work under the [GNU General Public License v3](https://codeberg.org/GitNex/GitNex/src/branch/main/LICENSE).
qwerty287 added 2 commits 1 month ago
qwerty287 changed title from issue-to-repo to Allow navigating from issue to repo 1 month ago
mmarif added 1 commit 1 month ago
mmarif added the
Enhancement
label 1 month ago
mmarif added this to the 4.0.0 milestone 1 month ago
opyale requested changes 1 month ago
if(id == android.R.id.home) {
if (!tinyDB.getBoolean("issueOpenedFromList")) startActivity(new Intent(this, RepoDetailActivity.class));
opyale commented 1 month ago
Poster
Collaborator

I suspect you have nothing to hide, so please use parenthesis. 😉

I suspect you have nothing to hide, so please use parenthesis. 😉
Poster

It looks better after this: 3f5ce93502

It looks better after this: https://codeberg.org/gitnex/GitNex/commit/3f5ce9350243ea8380dc1cd963a9d95dcae827dc
qwerty287 marked this conversation as resolved
qwerty287 added 1 commit 1 month ago
mmarif requested changes 1 month ago
if(id == android.R.id.home) {
if(!tinyDB.getBoolean("issueOpenedFromList")) {
Intent intent = new Intent(this, RepoDetailActivity.class);
mmarif commented 1 month ago
Poster
Owner

The only concern I have here is that this may create 2nd instance of activities in case the app is already open and minimized:

  • If let's say the app is open with the same issue/pr.
  • If the repository is open already.
The only concern I have here is that this may create 2nd instance of activities in case the app is already open and minimized: - If let's say the app is open with the same issue/pr. - If the repository is open already.
Poster

You're right, but any idea how to fix it? You would have to check if the issue/pr that's already open is from the same repo, and if they are the same, just go back to the previous issue and if not create a new activity? Or stop the other repo activities?

You're right, but any idea how to fix it? You would have to check if the issue/pr that's already open is from the same repo, and if they are the same, just go back to the previous issue and if not create a new activity? Or stop the other repo activities?
mmarif commented 1 month ago
Poster
Owner

Something like if (getActivity() instanceof RepoDetailActivity) { you can try. There are other methods too to check whether the activity is active.

Something like `if (getActivity() instanceof RepoDetailActivity) {` you can try. There are other methods too to check whether the activity is active.
Poster

The issue detail view is an own activity, so you can't get it like this (or I missunderstood you).

The issue detail view is an own activity, so you can't get it like this (or I missunderstood you).
Poster

I think I just found a way how it's working, I'm currently testing it and will push it after this

I think I just found a way how it's working, I'm currently testing it and will push it after this
Poster
https://codeberg.org/gitnex/GitNex/commit/f8dd493cef1b2dbc1df687ea68ebd31de489f6f6
mmarif commented 1 month ago
Poster
Owner

Will test.

Will test.
qwerty287 marked this conversation as resolved
qwerty287 added 1 commit 1 month ago
mmarif added 1 commit 1 month ago
Owner

@qwerty287 I have made changes to enhance the code using bundle(as we are moving away from TinyDB as much possible now) and fix the activities life.

Test and let me know.

@qwerty287 I have made changes to enhance the code using bundle(as we are moving away from TinyDB as much possible now) and fix the activities life. Test and let me know.
Poster

@mmarif

@qwerty287 I have made changes to enhance the code using bundle(as we are moving away from TinyDB as much possible now) and fix the activities life.

Test and let me know.

Thanks! I don't know when I have the time to test it, but I'll do it🙂

@mmarif >@qwerty287 I have made changes to enhance the code using bundle(as we are moving away from TinyDB as much possible now) and fix the activities life. > >Test and let me know. Thanks! I don't know when I have the time to test it, but I'll do it🙂
Poster

@mmarif I tested it and can confirm that it's working

@mmarif I tested it and can confirm that it's working
mmarif approved these changes 1 month ago
qwerty287 requested review from opyale 1 month ago
Collaborator

does not work for me anymore :/

does not work for me anymore :/
Poster

Hmm... I tested it some time ago and it worked perfectly. But @mmarif, now if I look again at the code, your solution doesn't work if you open an issue/pr from a notification, @6543 maybe this was the issue? It should only work with a link, this should be fixed. Unfortunately, I'm currently not able to access my computer, so I can't fix it in the next ~2 weeks (I could add you as collaborator, if somebody wants to fix it)

Hmm... I tested it some time ago and it worked perfectly. But @mmarif, now if I look again at the code, your solution doesn't work if you open an issue/pr from a notification, @6543 maybe this was the issue? It should only work with a link, this should be fixed. Unfortunately, I'm currently not able to access my computer, so I can't fix it in the next ~2 weeks (I could add you as collaborator, if somebody wants to fix it)
Poster

And just a question: Octodroid uses the same behavior if you use the back button on a repo detail screen, but then it opens the owner of the repo. Should this be implemented (maybe in a different PR)? Something that would be nice is an API that checks if a username is an org or a user. @6543 is there something like this? This would make it even simpler for the link handlers to find out if it's a user or an org and open the correct activity.

And just a question: Octodroid uses the same behavior if you use the back button on a repo detail screen, but then it opens the owner of the repo. Should this be implemented (maybe in a different PR)? Something that would be nice is an API that checks if a username is an org or a user. @6543 is there something like this? This would make it even simpler for the link handlers to find out if it's a user or an org and open the correct activity.
Owner

does not work for me anymore :/

@6543 This will only work if come to issue/pr directly from a link. Can you describe what steps you followed and it does not work?

now if I look again at the code, your solution doesn't work if you open an issue/pr from a notification

@qwerty287 coming to notitfications and then going to issue/pr is totally different and not part of this PR.

It could be added though in another PR or this PR. I propose another one.

> does not work for me anymore :/ @6543 This will only work if come to issue/pr directly from a link. Can you describe what steps you followed and it does not work? > now if I look again at the code, your solution doesn't work if you open an issue/pr from a notification @qwerty287 coming to notitfications and then going to issue/pr is totally different and not part of this PR. It could be added though in another PR or this PR. I propose another one.
qwerty287 added 1 commit 2 weeks ago
6543 approved these changes 2 weeks ago
6543 left a comment

👍

6543 merged commit 0e696eb46f into main 2 weeks ago
6543 referenced this issue from a commit 2 weeks ago
qwerty287 deleted branch issue-to-repo 1 week ago

Reviewers

mmarif approved these changes 1 month ago
opyale was requested for review 1 month ago
6543 approved these changes 2 weeks ago
The pull request has been merged as 0e696eb46f.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.