Skip to content

Fix shortcuts implementation#73

Open
Jonniie wants to merge 9 commits into
DhanushNehru:mainfrom
Jonniie:fix-shortcuts-implementation
Open

Fix shortcuts implementation#73
Jonniie wants to merge 9 commits into
DhanushNehru:mainfrom
Jonniie:fix-shortcuts-implementation

Conversation

@Jonniie

@Jonniie Jonniie commented Oct 11, 2025

Copy link
Copy Markdown

Add delete confirmation dialog for shortcut delete action and fix duplicate note shortcut action

@vercel

vercel Bot commented Oct 11, 2025

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Dhanush Nehru's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Jonniie

Jonniie commented Oct 14, 2025

Copy link
Copy Markdown
Author

@DhanushNehru kindly review the open PRs

@DhanushNehru DhanushNehru requested a review from Copilot October 15, 2025 08:20
@vercel

vercel Bot commented Oct 15, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
scratchpad-scribe Ready Ready Preview Comment Oct 19, 2025 3:35pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the shortcuts implementation by adding a confirmation dialog for note deletion and reorganizing the duplicate note shortcut from Ctrl/Cmd+D to Ctrl/Cmd+Shift+D to avoid conflicts. Additionally, it improves the authentication modal with password visibility toggles and confirmation fields.

  • Added delete confirmation dialog to prevent accidental note deletion
  • Moved duplicate note shortcut to Ctrl/Cmd+Shift+D and added Shift+D as alternative
  • Enhanced authentication modal with password visibility controls and confirmation field

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/pages/Index.tsx Implements delete confirmation dialog, reorganizes keyboard shortcuts, and updates shortcut documentation
src/components/ui/AuthModal.tsx Adds password visibility toggles and confirm password field for registration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/pages/Index.tsx Outdated
Comment on lines +160 to +172
if (isShift && !isCtrlOrMeta) {
switch (key) {
case "d": {
event.preventDefault();
event.stopPropagation();
if (activeNoteId) {
handleDuplicateNote(activeNoteId);
toast.success("Note duplicated");
}
break;
}
}
}

Copilot AI Oct 15, 2025

Copy link

Choose a reason for hiding this comment

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

Duplicate code: The Shift+D case (lines 162-170) contains identical logic to the Ctrl/Cmd+Shift+D case (lines 147-155). Consider extracting this logic into a shared function to avoid code duplication.

Copilot uses AI. Check for mistakes.
Comment thread src/pages/Index.tsx Outdated
Comment on lines +248 to +251
<kbd className="px-2 py-0.5 bg-muted rounded border border-border font-mono">
Ctrl+Shift+D
</kbd>
</div>

Copilot AI Oct 15, 2025

Copy link

Choose a reason for hiding this comment

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

The shortcut documentation only shows 'Ctrl+Shift+D' but the code also supports 'Shift+D' alone. The documentation should reflect both available shortcuts or clarify which is the primary one.

Suggested change
<kbd className="px-2 py-0.5 bg-muted rounded border border-border font-mono">
Ctrl+Shift+D
</kbd>
</div>
<div className="flex gap-2">
<kbd className="px-2 py-0.5 bg-muted rounded border border-border font-mono">
Ctrl+Shift+D
</kbd>
<span className="text-xs text-muted-foreground">or</span>
<kbd className="px-2 py-0.5 bg-muted rounded border border-border font-mono">
Shift+D
</kbd>
</div>

Copilot uses AI. Check for mistakes.
@Jonniie

Jonniie commented Oct 15, 2025

Copy link
Copy Markdown
Author

@DhanushNehru All suggestions reviewed and fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/pages/Index.tsx Outdated
Comment thread src/components/ui/AuthModal.tsx Outdated
Jonniie and others added 2 commits October 17, 2025 11:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Jonniie

Jonniie commented Oct 17, 2025

Copy link
Copy Markdown
Author

@DhanushNehru kindly merge now

@DhanushNehru DhanushNehru requested a review from Copilot October 19, 2025 15:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/pages/Index.tsx
Comment on lines +252 to +263
<div className="flex items-center justify-between gap-4">
<span>Duplicate note</span>
<div className="flex items-center gap-2">
<kbd className="px-2 py-0.5 bg-muted rounded border border-border font-mono">
Shift+D
</kbd>
<span className="text-muted-foreground">or</span>
<kbd className="px-2 py-0.5 bg-muted rounded border border-border font-mono">
Cmd/Ctrl+Shift+D
</kbd>
</div>
</div>

Copilot AI Oct 19, 2025

Copy link

Choose a reason for hiding this comment

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

The keyboard shortcut documentation shows 'Shift+D' as an option for duplicating notes, but this shortcut is not implemented in the handleKeyDown function. Only 'Ctrl/Cmd+Shift+D' is actually handled.

Copilot uses AI. Check for mistakes.

<div
className="w-16 h-0.5 mx-auto my-2 rounded-full bg-gradient-to-r from-orange-500 via-orange-400 to-orange-100"
></div>

Copilot AI Oct 19, 2025

Copy link

Choose a reason for hiding this comment

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

The empty div tag should be self-closing for consistency with JSX best practices.

Suggested change
></div>
/>

Copilot uses AI. Check for mistakes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/pages/Index.tsx
const isShift = event.shiftKey;

// Handle Ctrl/Cmd + key combinations
if (isCtrlOrMeta && !isShift) {

Copilot AI Oct 19, 2025

Copy link

Choose a reason for hiding this comment

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

The keyboard shortcut handling logic has an issue where isShift is extracted but the condition !isShift in line 118 will prevent Shift+key combinations from being processed in the first block, even though some shortcuts might legitimately use Shift modifiers.

Suggested change
if (isCtrlOrMeta && !isShift) {
if (isCtrlOrMeta) {

Copilot uses AI. Check for mistakes.
Comment on lines +111 to +113
<div
className="w-16 h-0.5 mx-auto my-2 rounded-full bg-gradient-to-r from-orange-500 via-orange-400 to-orange-100"
></div>

Copilot AI Oct 19, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The self-closing div tag should use the more conventional <div></div> format instead of <div></div> for better readability and consistency with JSX conventions.

Copilot uses AI. Check for mistakes.
@learner-enthusiast

Copy link
Copy Markdown
Collaborator

Can you attach a video based on current deployed version and your branch in local

@Jonniie

Jonniie commented Oct 22, 2025

Copy link
Copy Markdown
Author

@DhanushNehru I've resolved the merge conflic here as well

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants