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

Support paste treepath when creating a new file or updating the file name #23209

Merged
merged 19 commits into from
Mar 3, 2023

Conversation

HesterG
Copy link
Contributor

@HesterG HesterG commented Mar 1, 2023

Close #23204

Quick Demo:

2023-03-01.13.56.16.mov

@techknowlogick techknowlogick added this to the 1.20.0 milestone Mar 1, 2023
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 1, 2023
@HesterG HesterG added the topic/ui Change the appearance of the Gitea UI label Mar 1, 2023
@HesterG
Copy link
Contributor Author

HesterG commented Mar 2, 2023

Separated the two events, please review again.

$divider.last().remove();
}

joinTreePath($(this));
Copy link
Contributor

Choose a reason for hiding this comment

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

One more last thought 😂

Could this call be moved into the if above? This call is only needed when the path changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One more last thought 😂

Could this call be moved into the if above? This call is only needed when the path changes.

Sure that makes sense

Copy link
Contributor

@wxiaoguang wxiaoguang Mar 2, 2023

Choose a reason for hiding this comment

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

Oh, another last thought ... many $() could be also moved to out scope? Then we do not need to spend CPU time on every keyup/input event.

eg:

    const $section = $('.breadcrumb span.section');
    const $divider = $('.breadcrumb div.divider');
    $editFilename.on('input', ... ) 
    $editFilename.on('keyup', ... )

Ignore me, it seems that the section/divider changes ....

It looks good to me.

Copy link
Contributor Author

@HesterG HesterG Mar 2, 2023

Choose a reason for hiding this comment

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

Oh, another last thought ... many $() could be also moved to out scope? Then we do not need to spend CPU time on every keyup/input event.

This will cause problem. Because the events should get the lastest elements' status(like $section.length). If they are intialized outside, the elements will have the status on created. e.g., $section.length stays 0.

@HesterG HesterG requested review from silverwind, wxiaoguang and wolfogre and removed request for wxiaoguang March 2, 2023 03:41
@wolfogre
Copy link
Member

wolfogre commented Mar 2, 2023

Noticed the different behavior when deleting the last letter.

2023-03-02.11.56.12.mov

@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2023

Codecov Report

Merging #23209 (09c6836) into main (33e556e) will increase coverage by 0.12%.
The diff coverage is 55.09%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main   #23209      +/-   ##
==========================================
+ Coverage   47.44%   47.56%   +0.12%     
==========================================
  Files        1140     1143       +3     
  Lines      150804   151076     +272     
==========================================
+ Hits        71549    71866     +317     
+ Misses      70788    70712      -76     
- Partials     8467     8498      +31     
Impacted Files Coverage Δ
cmd/serv.go 2.59% <0.00%> (-0.06%) ⬇️
models/actions/run.go 1.72% <0.00%> (+0.01%) ⬆️
models/actions/run_list.go 0.00% <0.00%> (ø)
models/actions/status.go 22.85% <0.00%> (-1.39%) ⬇️
models/actions/task.go 1.69% <0.00%> (-0.01%) ⬇️
models/auth/oauth2.go 60.52% <ø> (ø)
models/auth/twofactor.go 19.73% <ø> (ø)
models/db/engine.go 44.80% <ø> (ø)
models/unittest/testdb.go 12.92% <0.00%> (ø)
modules/auth/password/hash/pbkdf2.go 69.69% <ø> (ø)
... and 117 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@HesterG
Copy link
Contributor Author

HesterG commented Mar 2, 2023

Noticed the different behavior when deleting the last letter.

Fixed in latest commit

@HesterG
Copy link
Contributor Author

HesterG commented Mar 2, 2023

Update current deletion behavoir and paste using mouse behavior in addition to paste by keyboard:

2023-03-02.14.51.20.mov

@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 Mar 2, 2023
web_src/js/features/repo-editor.js Outdated Show resolved Hide resolved
@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 Mar 2, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 3, 2023
@techknowlogick techknowlogick merged commit 7f9d58f into go-gitea:main Mar 3, 2023
@lunny lunny removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 4, 2023
@HesterG HesterG deleted the support-paste-treepath branch March 6, 2023 08:02
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
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. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support pasting treepath when add a new file to the repo
9 participants