Repository navigation
Move rebuild into the Leaflet menu and sidebar icon row #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ import { | |
| X, | ||
| } from 'lucide-react'; | ||
| import { getCurrentWindow } from '@tauri-apps/api/window'; | ||
| import { listen } from '@tauri-apps/api/event'; | ||
| import { | ||
| chooseArchive, | ||
| desktop, | ||
|
|
@@ -149,6 +150,13 @@ export default function App() { | |
| useEffect(() => { | ||
| void load(readPreference<string>('root', '')); | ||
| }, [load]); | ||
| useEffect(() => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should-fix: The new |
||
| if (!desktop) return; | ||
| const unlisten = listen('open-rebuild', () => setRebuildOpen(true)); | ||
| return () => { | ||
| void unlisten.then((stop) => stop()); | ||
| }; | ||
| }, []); | ||
| useEffect(() => { | ||
| if (!desktop || !rootKey || busy) return; | ||
| setSyncError(null); | ||
|
|
@@ -433,12 +441,6 @@ export default function App() { | |
| })} | ||
| </div> | ||
| <div className="sidebar-bottom"> | ||
| {desktop && ( | ||
| <button className="surprise" onClick={() => setRebuildOpen(true)}> | ||
| <Hammer size={16} /> | ||
| Rebuild app | ||
| </button> | ||
| )} | ||
| <button | ||
| className="surprise" | ||
| onClick={randomEntry} | ||
|
|
@@ -467,6 +469,15 @@ export default function App() { | |
| : 'Auto-refresh · 1 min' | ||
| : 'Demo journal'} | ||
| </span> | ||
| {desktop && ( | ||
| <button | ||
| title="Rebuild app" | ||
| aria-label="Rebuild app" | ||
| onClick={() => setRebuildOpen(true)} | ||
| > | ||
| <Hammer size={14} /> | ||
| </button> | ||
| )} | ||
| <button | ||
| title="Refresh journal" | ||
| aria-label="Refresh journal" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: The Leaflet submenu is found by comparing its text to
app.package_info().name, and the item is inserted at a hard-coded index 2. If the name doesn't match, or the Tauri default menu layout changes, the Rebuild item silently disappears with no log. Consider logging when the submenu isn't found, or adding a comment explaining that index 2 sits just after About and the separator.