Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,8 @@ docs/build/

# Temporary folders
tmp/
temp/
temp/

# Ignore Docker-related files for Prettier
motia/Dockerfile
motia/.dockerignore
7 changes: 7 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"lucide-react": "^0.545.0",
"markdown-it": "^14.1.0",
"markdown-it-deflist": "^3.0.0",
"markdown-it-link-attributes": "^4.0.1",
"markdown-it-task-lists": "^2.1.1",
"prop-types": "^15.8.1",
"react": "^18.3.1",
Expand Down
96 changes: 65 additions & 31 deletions frontend/src/components/dashboard/Note.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,41 +188,75 @@ const Note = ({ activePage, onContentChange, content = '', onSave }) => {
};

const handleKeyDown = (e) => {
if (e.ctrlKey || e.metaKey) {
switch (e.key.toLowerCase()) {
case 'z':
if (e.shiftKey) {
e.preventDefault();
handleRedo();
} else {
e.preventDefault();
handleUndo();
}
break;
case 'y':
// πŸ”Ή Auto-insert bullet or number on new line for lists
if (e.key === 'Enter') {
const textarea = e.target;
const { selectionStart, selectionEnd, value } = textarea;

// Get current line text before cursor
const beforeCursor = value.substring(0, selectionStart);
const currentLine = beforeCursor.split('\n').pop();

// Match bullet (-, *, +) or numbered list (1.)
const match = currentLine.match(/^(\s*[-*+]|\s*\d+\.)\s+/);

if (match) {
e.preventDefault();
const bullet = match[0];
const newValue =
value.substring(0, selectionStart) +
`\n${bullet}` +
value.substring(selectionEnd);

setEditorContent(newValue);
addToHistory(newValue);

// Move cursor to the right position after the bullet
requestAnimationFrame(() => {
const newPos = selectionStart + bullet.length + 1;
textarea.selectionStart = textarea.selectionEnd = newPos;
});
return; // Stop further key handling
}
}

// πŸ”Ή Handle keyboard shortcuts (undo, redo, bold, italic, save)
if (e.ctrlKey || e.metaKey) {
switch (e.key.toLowerCase()) {
case 'z':
if (e.shiftKey) {
e.preventDefault();
handleRedo();
break;
case 'b':
e.preventDefault();
wrapSelectedText('**', '**', 'bold text');
break;
case 'i':
e.preventDefault();
wrapSelectedText('*', '*', 'italic text');
break;
case 's':
} else {
e.preventDefault();
if (onSave) {
onSave();
toast.success('Note saved!');
}
break;
default:
break;
}
handleUndo();
}
break;
case 'y':
e.preventDefault();
handleRedo();
break;
case 'b':
e.preventDefault();
wrapSelectedText('**', '**', 'bold text');
break;
case 'i':
e.preventDefault();
wrapSelectedText('*', '*', 'italic text');
break;
case 's':
e.preventDefault();
if (onSave) {
onSave();
toast.success('Note saved!');
}
break;
default:
break;
}
};
}
};


const handleContentChange = (e) => {
const newContent = e.target.value;
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/components/home/ExampleNote.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ const ExampleNote = () => {
Private β€’ Edited {timeAgo}
</div>
</div>
<p
className="mt-3 text-sm text-[color:var(--color-neutral-content)] leading-relaxed h-38 overflow-y-auto"
contentEditable={isEditing}
suppressContentEditableWarning={true}
>
<p
className="mt-3 text-sm text-[color:var(--color-neutral-content)] leading-relaxed min-h-48 max-h-80 overflow-y-auto p-3 rounded-md border border-[color:var(--color-base-300)] bg-[color:var(--color-base-200)]"
contentEditable={isEditing}
suppressContentEditableWarning={true}
>
Quick summary: Decide migration plan for the frontend β€” start with a Vite parallel folder,
migrate auth pages first, then dashboard. Public share will be read-only links.
</p>
Expand Down
Loading
Loading