Skip to content

display context menu for files in commit history - #4037

Merged
iAmWillShepherd merged 37 commits into
desktop:masterfrom
crea7or:feature/history-context-menu
Apr 25, 2018
Merged

iAmWillShepherd merged 37 commits into
desktop:masterfrom
crea7or:feature/history-context-menu

Conversation

@crea7or

@crea7or crea7or commented Feb 18, 2018 •

Copy link
Copy Markdown
Contributor

Fixes #2845

This code will add context menu for the files in the repo history with these comands: open and show in explorer. Opening/finding file from the commit is a very handy thing and here is issue about this context menu opened in the Github Desktop repo.
There is only basic functionality without actuall checks if the selected file still exist in the repo, but code that checks for potentially dangerous files is here (actually copied from changed-file.tsx).

@crea7or

crea7or commented Feb 18, 2018

Copy link
Copy Markdown
Contributor Author

cc

@iAmWillShepherd

Copy link
Copy Markdown
Contributor

Looks like your PR is very similar to the work found in PR #4030.

@crea7or

crea7or commented Feb 21, 2018

Copy link
Copy Markdown
Contributor Author

@iAmWillShepherd yep, I think that they can be merged together (however I have no idea how).

@crea7or

crea7or commented Feb 21, 2018

Copy link
Copy Markdown
Contributor Author

and additional menu option can be added to my pr.

@crea7or

crea7or commented Feb 23, 2018

Copy link
Copy Markdown
Contributor Author

@iAmWillShepherd Can I fork your branch and send my changes into your PR?

@iAmWillShepherd

Copy link
Copy Markdown
Contributor

@crea7or Let's keep them as a separate PRs since #4030 addresses a specific issue. After that is merged, we can work together to make sure your PR matches the behavior of mine. Notice how the user's preferred editor is in the menu?

@crea7or

crea7or commented Feb 24, 2018

Copy link
Copy Markdown
Contributor Author

@iAmWillShepherd already implemented it:
ddddd

@crea7or

crea7or commented Mar 27, 2018

Copy link
Copy Markdown
Contributor Author

@iAmWillShepherd I have finished changes according to your pr #4030 .

@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Mar 29, 2018
@shiftkey shiftkey self-assigned this Mar 29, 2018
Comment thread app/src/ui/history/file-list.tsx Outdated
{
label: revealInFileManagerLabel,
action: () => this.props.onRevealInFileManager(filePath),
enabled: this.props.selectedFile.status !== AppFileStatus.Deleted,

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/ui/history/file-list.tsx Outdated
import { showContextualMenu } from '../main-process-proxy'
import { IMenuItem } from '../../lib/menu-item'

const RestrictedFileExtensions = ['.cmd', '.exe', '.bat', '.sh']

This comment was marked as spam.

This comment was marked as spam.

@shiftkey shiftkey removed their assignment Apr 12, 2018
@shiftkey

Copy link
Copy Markdown
Member

Dropping myself from this review as I've contributed to a bunch of the refactoring/cleanup.

@shiftkey

Copy link
Copy Markdown
Member

🍎

@shiftkey shiftkey changed the title context menu for files in commit history (open/show in explorer) display context menu for files in commit history Apr 12, 2018
@iAmWillShepherd iAmWillShepherd self-assigned this Apr 16, 2018
Comment thread app/src/lib/app-shell.ts Outdated
* @param path The path of the file relative to the root of the repository
*/
export function revealInFileManager(repository: Repository, path: string) {
const normalized = Path.join(repository.path, path)

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/ui/history/file-list.tsx Outdated
readonly availableWidth: number

/**
* Called to open a file it its default application

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/ui/history/file-list.tsx Outdated
if (!fileExistsOnDisk) {
showContextualMenu([
{
label: 'File does not exist on disk',

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/ui/history/file-list.tsx Outdated
enabled: isSafeExtension && fileExistsOnDisk,
},
{
label: __DARWIN__

This comment was marked as spam.

This comment was marked as spam.

@shiftkey shiftkey removed the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 18, 2018
@shiftkey

Copy link
Copy Markdown
Member

We're working on getting #4188 merged for the next release which is a big change, and there are merge conflict changes between that branch and this one. To ensure we don't create additional work for #4188 by merging this early, I'm going to drop the ready-for-review label for now.

@crea7or

crea7or commented Apr 19, 2018

Copy link
Copy Markdown
Contributor Author

So, I tried to merge it - please review.

@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 23, 2018
@shiftkey

Copy link
Copy Markdown
Member

@crea7or thanks for following up with this! I ran through some tests on this again and it all seems file, but I'll let @iAmWillShepherd follow up with any outstanding feedback he has.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants