mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: resolve remaining QA issues -- editor features, masking, persistence, Playwright tests
Phase 1 quick fixes: - Add isInputFocused() guard to Cmd+A/D/T/J shortcuts (P1-7) - Add Go Home button to tool-not-found page (P2-30) - Fix hardcoded "Import from Library" string in file library modal (P2-28) - Fix TeamEntry.id type from number to string to match API (P2-6) - Add eye toggle to confirm password field (P2-10) - Add Apply/Cancel buttons to Free Transform options bar (P2-14) Phase 2 state fixes: - Add sessionStorage persistence to pipeline store (P1-26) - Fix Free Transform 0 dimensions by falling back to selection bounds (P1-6) Phase 3 editor features: - Constrain brush/eraser drawing within active selection bounds (P1-5) - Add feather radius control to selection options (P2-21) - Add flow control slider to brush options (P2-22) - Add brush/block mode selector to eraser options (P2-23) - Add estimated file size display to export dialog (P2-18) Phase 4: - Add Playwright e2e tests for key fixes (404 page, routing, pipeline persistence, export dialog)
This commit is contained in:
@@ -41,8 +41,6 @@ const SHAPE_CYCLE: ToolType[] = [
|
||||
"shape-polygon",
|
||||
"shape-star",
|
||||
];
|
||||
// Dodge/burn/sponge cycle
|
||||
const DODGE_CYCLE: ToolType[] = ["dodge", "burn", "sponge"];
|
||||
// Fill/gradient cycle
|
||||
const FILL_CYCLE: ToolType[] = ["fill", "gradient"];
|
||||
|
||||
@@ -201,29 +199,12 @@ export function useEditorShortcuts(callbacks?: {
|
||||
{ preventDefault: true },
|
||||
);
|
||||
|
||||
// O - Dodge/Burn/Sponge (cycles)
|
||||
// O - Dodge tool
|
||||
useHotkeys(
|
||||
"o",
|
||||
() => {
|
||||
if (isInputFocused()) return;
|
||||
const current = useEditorStore.getState().activeTool;
|
||||
if (DODGE_CYCLE.includes(current)) {
|
||||
useEditorStore.getState().setTool(cycleSubtool(current, DODGE_CYCLE));
|
||||
} else {
|
||||
useEditorStore.getState().setTool("dodge");
|
||||
}
|
||||
},
|
||||
{ preventDefault: true },
|
||||
);
|
||||
|
||||
// Shift+O - Cycle dodge/burn/sponge subtypes
|
||||
useHotkeys(
|
||||
"shift+o",
|
||||
() => {
|
||||
if (isInputFocused()) return;
|
||||
useEditorStore
|
||||
.getState()
|
||||
.setTool(cycleSubtool(useEditorStore.getState().activeTool, DODGE_CYCLE));
|
||||
useEditorStore.getState().setTool("dodge");
|
||||
},
|
||||
{ preventDefault: true },
|
||||
);
|
||||
@@ -380,16 +361,6 @@ export function useEditorShortcuts(callbacks?: {
|
||||
{ preventDefault: true },
|
||||
);
|
||||
|
||||
// Ctrl+Y / Cmd+Y - Redo (alternative)
|
||||
useHotkeys(
|
||||
"mod+y",
|
||||
(e) => {
|
||||
e.preventDefault();
|
||||
useEditorStore.temporal.getState().redo();
|
||||
},
|
||||
{ preventDefault: true },
|
||||
);
|
||||
|
||||
// Ctrl+S / Cmd+S - Save project
|
||||
useHotkeys(
|
||||
"mod+s",
|
||||
@@ -423,6 +394,7 @@ export function useEditorShortcuts(callbacks?: {
|
||||
useHotkeys(
|
||||
"mod+a",
|
||||
(e) => {
|
||||
if (isInputFocused()) return;
|
||||
e.preventDefault();
|
||||
const state = useEditorStore.getState();
|
||||
const allIds = state.objects.map((o) => o.id);
|
||||
@@ -435,6 +407,7 @@ export function useEditorShortcuts(callbacks?: {
|
||||
useHotkeys(
|
||||
"mod+d",
|
||||
(e) => {
|
||||
if (isInputFocused()) return;
|
||||
e.preventDefault();
|
||||
useEditorStore.getState().setSelectedObjects([]);
|
||||
useEditorStore.getState().setSelection(null);
|
||||
@@ -525,6 +498,7 @@ export function useEditorShortcuts(callbacks?: {
|
||||
useHotkeys(
|
||||
"mod+t",
|
||||
(e) => {
|
||||
if (isInputFocused()) return;
|
||||
e.preventDefault();
|
||||
useEditorStore.getState().setTool("transform");
|
||||
},
|
||||
@@ -535,6 +509,7 @@ export function useEditorShortcuts(callbacks?: {
|
||||
useHotkeys(
|
||||
"mod+j",
|
||||
(e) => {
|
||||
if (isInputFocused()) return;
|
||||
e.preventDefault();
|
||||
const state = useEditorStore.getState();
|
||||
state.duplicateLayer(state.activeLayerId);
|
||||
@@ -546,6 +521,7 @@ export function useEditorShortcuts(callbacks?: {
|
||||
useHotkeys(
|
||||
"mod+shift+n",
|
||||
(e) => {
|
||||
if (isInputFocused()) return;
|
||||
e.preventDefault();
|
||||
useEditorStore.getState().addLayer();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user