Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizable "Open with" applications for repository clone #29320

Merged
merged 5 commits into from
Feb 24, 2024

Conversation

wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Feb 22, 2024

I think this approach is simple and flexible enough. And it is a complete solution.

Replace #22378
Close #21121
Close #22149

Default

image

Customized

image

image

@wxiaoguang wxiaoguang added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 22, 2024
@wxiaoguang wxiaoguang added this to the 1.22.0 milestone Feb 22, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 22, 2024
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 22, 2024
@wxiaoguang
Copy link
Contributor Author

At the moment, it doesn't support user-level customization, because the "user setting" package is not that mature as the system setting package. It should be easy to add user-level setting in the future, just override the system setting.

@lunny
Copy link
Member

lunny commented Feb 22, 2024

Can we add a reset button?

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Feb 22, 2024

Can we also add gitpod as default?

ffbe671 , I am not sure whether it works.

Can we add a reset button?

Just clear the textarea, then this setting is reset.

@lunny
Copy link
Member

lunny commented Feb 22, 2024

Can we also add gitpod as default?

ffbe671 , I am not sure whether it works.
blocked by gitpod-io/gitpod#8131

Can we add a reset button?

Just clear the textarea, then this setting is reset.

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Feb 22, 2024

Can we also add gitpod as default?

ffbe671 , I am not sure whether it works.

blocked by gitpod-io/gitpod#8131

So feel free to remove it.

@jolheiser
Copy link
Member

Can this be sourced from the config as well? I don't recall if we have a mechanism for that.

@wxiaoguang
Copy link
Contributor Author

Can this be sourced from the config as well? I don't recall if we have a mechanism for that.

If anyone really needs "sourcing from the config", I could propose a following PR. The "system setting" package has the ability to do so. But I do not think it's worth to do so at the moment. I guess we don't want to maintain too many config systems or config documents.

@lunny
Copy link
Member

lunny commented Feb 22, 2024

Can this be sourced from the config as well? I don't recall if we have a mechanism for that.

I would like to move most configurations from app.ini to database/UI but not the opposite.
For app.ini configuration, it needs to restart once the configuration changed.

@jolheiser
Copy link
Member

Then perhaps an API/CLI to set these things. My concern is only being able to set/change these from the web UI. Manually fiddling with the database seems like a no-go for deployment purposes.

@wxiaoguang
Copy link
Contributor Author

Then perhaps an API/CLI to set these things. My concern is only being able to set/change these from the web UI. Manually fiddling with the database seems like a no-go for deployment purposes.

Sure, I fully understand this point. So if there is a real requirement in the future, I will propose related solutions.

@lunny
Copy link
Member

lunny commented Feb 22, 2024

Then perhaps an API/CLI to set these things. My concern is only being able to set/change these from the web UI. Manually fiddling with the database seems like a no-go for deployment purposes.

Maybe a generic Configuration API is better.

@delvh
Copy link
Member

delvh commented Feb 22, 2024

Could you please add a docs page showing what common editors expect?
That way, users know what they are supposed to enter without much doubt.
(It does not need to be complete, that's what we have the community for. If they want another editor, they are free to open a PR.)

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Feb 22, 2024

Could you please add a docs page showing what common editors expect?

Sorry I didn't quite catch your point. Could you elaborate "what kind of doc page / where to be put" and what is "what common editors expect" ?


If you mean that "show users the example links for some editors", you could just click here, then you will see all builtin editors, they could be used as example.

image

image

@wxiaoguang wxiaoguang requested a review from delvh February 23, 2024 04:31
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 23, 2024
@GiteaBot GiteaBot removed the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Feb 24, 2024
@GiteaBot GiteaBot added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Feb 24, 2024
@wxiaoguang wxiaoguang enabled auto-merge (squash) February 24, 2024 12:42
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 24, 2024
@wxiaoguang wxiaoguang merged commit 29a26d9 into go-gitea:main Feb 24, 2024
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 24, 2024
@wxiaoguang wxiaoguang deleted the improve-open-with branch February 24, 2024 13:21
@@ -15,8 +15,45 @@ type PictureStruct struct {
EnableFederatedAvatar *config.Value[bool]
}

type OpenWithEditorApp struct {
Copy link
Member

Choose a reason for hiding this comment

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

Is there perhaps any way to set a custom icon, i.e. as a file path?
Once we have this option, this feature is truly complete.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have left a TODO in code:

iconHTML = svg.RenderHTML("gitea-git", 16, "gt-mr-3") // TODO: it could support user's customized icon in the future

To support "custom icon", it needs far more changes: it needs an extra field, and needs a new UI editor for the config items (at least, a YAML or JSON editor). It still needs the end user to upload the icon to "somewhere", I guess most users would be quite lazy to do so .....

So at the moment, the default "git" icons looks not bad.

Copy link
Member

@silverwind silverwind Feb 24, 2024

Choose a reason for hiding this comment

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

SVG icons could be entered as text in that box, e.g. name=url,icon=<svg/>. That said, I kind of dislike that the current syntax is not pure key=value pairs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, that's why I think "and needs a new UI editor for the config items (at least, a YAML or JSON editor)".

Let's collect more user feedbacks, to see how to move on.

Copy link
Member

Choose a reason for hiding this comment

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

I guess we better already change the syntax to yaml/json now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's quite easy because it is stored as JSON in database. So, it could be rendered as JSON or YAML in the editor easily. It won't block anything.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2024
@lunny lunny added the type/changelog Adds the changelog for a new Gitea version label Mar 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/translation size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/changelog Adds the changelog for a new Gitea version type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clone option to directly clone into Jetbrains IDEs Support additional clone schemes
7 participants