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

Make issue suggestion work for all editors #33340

Merged
merged 4 commits into from
Jan 21, 2025

Conversation

wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Jan 21, 2025

And do not handle special keys when the text-expander popup exists

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 21, 2025
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 21, 2025
@wxiaoguang
Copy link
Contributor Author

image

image

image

@wxiaoguang wxiaoguang force-pushed the fix-suggestion-issue branch from 8444011 to a310c88 Compare January 21, 2025 02:49
@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 Jan 21, 2025
export function parseRepoOwnerPathInfo(pathname: string): RepoOwnerPathInfo {
const appSubUrl = window.config.appSubUrl;
if (appSubUrl && pathname.startsWith(appSubUrl)) pathname = pathname.substring(appSubUrl.length);
const path = (pathname || '').replace(/[#?].*$/, '');
Copy link
Member

Choose a reason for hiding this comment

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

two small problem to point out

  • may we should trust types and not null check pathname. to use empty string can hide callers issue
  • when it is not a repo path, we returns empty object and check if ownerName is exists even though it's type does not say it can be nullable. may we can return null instead null ownerName?

Copy link
Contributor Author

@wxiaoguang wxiaoguang Jan 21, 2025

Choose a reason for hiding this comment

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

I didn't do that (use null) for 2 reasons:

  1. There was a long argument about returning null or not: Downscale pasted PNG images based on metadata #29123 (review)
  2. The parseIssueHref was already written that way: Fix context popup error #17398 (comment)

To avoid unnecessary arguments and changes, I didn't use null here.


The pathname usage has been improved in e4c8791

@wxiaoguang wxiaoguang added the backport/v1.23 This PR should be backported to Gitea 1.23 label Jan 21, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 21, 2025
@wxiaoguang wxiaoguang merged commit 2cb3946 into go-gitea:main Jan 21, 2025
26 checks passed
@wxiaoguang wxiaoguang deleted the fix-suggestion-issue branch January 21, 2025 11:33
@GiteaBot
Copy link
Collaborator

I was unable to create a backport for 1.23. @wxiaoguang, please send one manually. 🍵

go run ./contrib/backport 33340
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added the backport/manual No power to the bots! Create your backport yourself! label Jan 21, 2025
wxiaoguang added a commit to wxiaoguang/gitea that referenced this pull request Jan 21, 2025
And do not handle special keys when the text-expander popup exists
# Conflicts:
#	web_src/js/utils.test.ts
@wxiaoguang
Copy link
Contributor Author

Manually backport: Make issue suggestion work for all editors (#33340) #33342

@wxiaoguang wxiaoguang added the backport/done All backports for this PR have been created label Jan 21, 2025
wxiaoguang added a commit that referenced this pull request Jan 21, 2025
Backport #33340

And do not handle special keys when the text-expander popup exists
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 23, 2025
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Support disable passkey auth (go-gitea#33348)
  Update JS dependencies (go-gitea#33359)
  Enable Typescript `noImplicitAny` (go-gitea#33322)
  Remove duplicate "ResponseWriter.Status" method (go-gitea#33346)
  Fix code button alignment (go-gitea#33345)
  [skip ci] Updated translations via Crowdin
  Support performance trace (go-gitea#32973)
  Make issue suggestion work for all editors (go-gitea#33340)
  Fix issue count (go-gitea#33338)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.23 This PR should be backported to Gitea 1.23 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/bug type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants