fix: Hints

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs
2025-11-25 22:27:31 +01:00
parent d34ccaffd3
commit bc8768c4d9
5 changed files with 12 additions and 16 deletions

View File

@@ -70,6 +70,12 @@ const getHints = ({
});
}
if (activeTool.type === "arrow") {
if (appState.suggestedBinding) {
return t("hints.arrowBindModifiers", {
shortcut_1: getTaggedShortcutKey("Ctrl"),
shortcut_2: getTaggedShortcutKey("Alt"),
});
}
return t("hints.arrowTool", {
shortcut: getTaggedShortcutKey("A"),
});

View File

@@ -646,14 +646,8 @@ const LayerUI = ({
};
const stripIrrelevantAppStateProps = (appState: AppState): UIAppState => {
const {
suggestedBinding,
startBoundElement,
cursorButton,
scrollX,
scrollY,
...ret
} = appState;
const { startBoundElement, cursorButton, scrollX, scrollY, ...ret } =
appState;
return ret;
};

View File

@@ -341,7 +341,7 @@
"canvasPanning": "To move canvas, hold {{shortcut_1}} or {{shortcut_2}} while dragging, or use the hand tool",
"linearElement": "Click to start multiple points, drag for single line",
"arrowTool": "Click to start multiple points, drag for single line. Press {{shortcut}} again to change arrow type.",
"arrowBindModifiers": "Hold {{shortcut_1}} to bind inside, or {{shortcut_2}} to disable binding",
"arrowBindModifiers": "Hold {{shortcut_1}} to disable binding, or {{shortcut_2}} to bind at a fixed point",
"freeDraw": "Click and drag, release when you're finished",
"text": "Tip: you can also add text by double-clicking anywhere with the selection tool",
"embeddable": "Click-drag to create a website embed",

View File

@@ -203,7 +203,7 @@ exports[`move element > rectangles with binding arrow 7`] = `
0,
],
[
79,
"79.00000",
"124.16785",
],
],
@@ -228,7 +228,7 @@ exports[`move element > rectangles with binding arrow 7`] = `
"updated": 1,
"version": 12,
"versionNonce": 2066753033,
"width": 79,
"width": "79.00000",
"x": 111,
"y": "6.14995",
}

View File

@@ -474,11 +474,7 @@ export type SearchMatch = {
export type UIAppState = Omit<
AppState,
| "suggestedBinding"
| "startBoundElement"
| "cursorButton"
| "scrollX"
| "scrollY"
"startBoundElement" | "cursorButton" | "scrollX" | "scrollY"
>;
export type NormalizedZoomValue = number & { _brand: "normalizedZoom" };