|
| 1 | +<!-- Help content for the modal - extracted from help/index.html --> |
| 2 | +<nav class="toc"> |
| 3 | + <strong>Contents</strong> |
| 4 | + <ul> |
| 5 | + <li><a href="#overview">Overview</a></li> |
| 6 | + <li><a href="#pan-zoom">Pan & Zoom</a></li> |
| 7 | + <li><a href="#moving-tables">Moving Tables</a></li> |
| 8 | + <li><a href="#fields">Adding & Editing Fields</a></li> |
| 9 | + <li><a href="#keys">Primary & Unique Keys</a></li> |
| 10 | + <li><a href="#foreign-keys">Foreign Keys</a></li> |
| 11 | + <li><a href="#saving">Saving & Loading</a></li> |
| 12 | + <li><a href="#shortcuts">Shortcuts</a></li> |
| 13 | + <li><a href="#faq">Troubleshooting / FAQ</a></li> |
| 14 | + </ul> |
| 15 | +</nav> |
| 16 | + |
| 17 | +<section id="overview"> |
| 18 | + <h2>Overview</h2> |
| 19 | + <p>This page explains how to use the DB Schema Designer: create tables, add fields, set keys, connect tables, and save your work.</p> |
| 20 | + <!-- Example hero image: drop files into help/img/ and link relatively --> |
| 21 | + <!-- <img src="./img/overview.png" alt="Overview of the UI"> --> |
| 22 | +</section> |
| 23 | + |
| 24 | +<section id="pan-zoom"> |
| 25 | + <h2>Pan & Zoom</h2> |
| 26 | + <ul> |
| 27 | + <li>Use the mouse wheel to <em>zoom</em> in/out. The view zooms around your cursor.</li> |
| 28 | + <li><strong>Drag the empty background</strong> to pan the canvas.</li> |
| 29 | + </ul> |
| 30 | + <!-- <img src="./img/pan-zoom.gif" alt="Pan and zoom demonstration"> --> |
| 31 | +</section> |
| 32 | + |
| 33 | +<section id="moving-tables"> |
| 34 | + <h2>Moving Tables</h2> |
| 35 | + <p>Grab the dotted handle in the table header to drag a table.</p> |
| 36 | + <!-- <img src="./img/drag-handle.png" alt="The drag handle on a table"> --> |
| 37 | +</section> |
| 38 | + |
| 39 | +<section id="fields"> |
| 40 | + <h2>Adding & Editing Fields</h2> |
| 41 | + <ol> |
| 42 | + <li>Select a table from the diagram.</li> |
| 43 | + <li>Use the <em>Add Field</em> form in the sidebar: name, type, nullable/default, primary/unique.</li> |
| 44 | + <li>Click a field in the diagram to edit it again.</li> |
| 45 | + </ol> |
| 46 | + <!-- <img src="./img/add-field.png" alt="Adding a field"> --> |
| 47 | +</section> |
| 48 | + |
| 49 | +<section id="keys"> |
| 50 | + <h2>Primary & Unique Keys</h2> |
| 51 | + <p>Mark a field as <strong>Primary key</strong> or <strong>Unique</strong> in the field form. Primary keys are shown with a key icon.</p> |
| 52 | +</section> |
| 53 | + |
| 54 | +<section id="foreign-keys"> |
| 55 | + <h2>Foreign Keys</h2> |
| 56 | + <ol> |
| 57 | + <li>Choose the <em>From column</em>, <em>To table</em>, and <em>To column</em>.</li> |
| 58 | + <li>Pick an <em>On Delete</em> action (e.g., CASCADE).</li> |
| 59 | + <li>Click <em>Add FK</em>. Arrows will appear between related tables.</li> |
| 60 | + </ol> |
| 61 | + <p>To remove an FK for a field, select the field and use the <em>Remove</em> option (status text will confirm).</p> |
| 62 | + <!-- <img src="./img/add-fk.png" alt="Adding a foreign key"> --> |
| 63 | +</section> |
| 64 | + |
| 65 | +<section id="saving"> |
| 66 | + <h2>Saving & Loading</h2> |
| 67 | + <ul> |
| 68 | + <li><strong>Save solution</strong> – saves your schema to the server endpoint the app is configured with.</li> |
| 69 | + <li>Local autosave may also use <code>localStorage</code> when enabled.</li> |
| 70 | + </ul> |
| 71 | +</section> |
| 72 | + |
| 73 | +<section id="shortcuts"> |
| 74 | + <h2>Shortcuts</h2> |
| 75 | + <ul> |
| 76 | + <li><strong>ESC</strong> - Close help modal</li> |
| 77 | + <li><strong>Mouse wheel</strong> - Zoom in/out</li> |
| 78 | + <li><strong>Drag background</strong> - Pan canvas</li> |
| 79 | + <li><strong>Click table</strong> - Select table</li> |
| 80 | + <li><strong>Click field</strong> - Edit field</li> |
| 81 | + </ul> |
| 82 | +</section> |
| 83 | + |
| 84 | +<section id="faq"> |
| 85 | + <h2>Troubleshooting / FAQ</h2> |
| 86 | + <details> |
| 87 | + <summary>How do I delete a table?</summary> |
| 88 | + <p>Select the table and click the "Delete" button in the sidebar. This will also remove any foreign keys connected to the table.</p> |
| 89 | + </details> |
| 90 | + |
| 91 | + <details> |
| 92 | + <summary>Can I change the color of tables?</summary> |
| 93 | + <p>Yes! Select a table and use the "Table color" dropdown in the sidebar to choose from white, blue, green, or red.</p> |
| 94 | + </details> |
| 95 | + |
| 96 | + <details> |
| 97 | + <summary>How do I add images to the help?</summary> |
| 98 | + <p>Place image files in the <code>help/img/</code> directory and reference them with relative paths like <code><img src="./img/example.png" alt="Description"></code></p> |
| 99 | + </details> |
| 100 | + |
| 101 | + <details> |
| 102 | + <summary>Is my work automatically saved?</summary> |
| 103 | + <p>Yes, the app automatically saves your schema every second to both localStorage and the server. You'll see "Auto-saved" status messages.</p> |
| 104 | + </details> |
| 105 | +</section> |
0 commit comments