Skip to content

Commit

Permalink
Add link to User Guide in "Help" menu
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-stemmler committed Nov 4, 2024
1 parent 4085391 commit d200838
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased] - (release date)

### Added

- Added link to User Guide in "Help" menu.

### Changed

- Decreased auto-scrolling acceleration when reordering columns.
Expand Down
5 changes: 3 additions & 2 deletions annimate_desktop/src/components/dialogs/about-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from '@/components/ui/tooltip';
import { shellOpen } from '@/lib/api';
import { useDbDir } from '@/lib/store';
import { URL_ANNIMATE, URL_GRAPHANNIS } from '@/lib/urls';
import { Folder } from 'lucide-react';
import { RefObject, useCallback, useEffect, useRef } from 'react';

Expand Down Expand Up @@ -58,7 +59,7 @@ export const AboutDialog = () => {
<Button
className="h-4 min-w-32 p-0"
onClick={() => {
shellOpen('https://github.com/matthias-stemmler/annimate');
shellOpen(URL_ANNIMATE);
}}
variant="link"
>
Expand All @@ -74,7 +75,7 @@ export const AboutDialog = () => {
<Button
className="h-4 p-0"
onClick={() => {
shellOpen('https://github.com/korpling/graphANNIS');
shellOpen(URL_GRAPHANNIS);
}}
variant="link"
>
Expand Down
34 changes: 29 additions & 5 deletions annimate_desktop/src/components/window.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,34 @@ import {
MenubarItem,
MenubarMenu,
MenubarSeparator,
MenubarShortcut,
MenubarTrigger,
} from '@/components/ui/menubar';
import { UpdateAppTrigger } from '@/components/update-app-trigger';
import { exit, shellOpen } from '@/lib/api';
import { URL_ANNIMATE_USER_GUIDE, URL_AQL_OPERATORS } from '@/lib/urls';
import { ExternalLink } from 'lucide-react';
import { FC } from 'react';
import { FC, useEffect } from 'react';
import { Outlet } from 'react-router-dom';

export const Window: FC = () => {
const [aboutDialogOpen, setAboutDialogOpen, aboutDialogKey] =
useDialogState();

useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
if (event.code === 'F1') {
shellOpen(URL_ANNIMATE_USER_GUIDE);
}
};

window.addEventListener('keydown', handleKeyDown);

return () => {
window.removeEventListener('keydown', handleKeyDown);
};
});

return (
<div className="flex h-full flex-col">
{window.__ANNIMATE__.updateEnabled && <UpdateAppTrigger />}
Expand All @@ -45,13 +61,21 @@ export const Window: FC = () => {
<MenubarContent>
<MenubarItem
onSelect={() => {
shellOpen(
'https://korpling.github.io/ANNIS/4.0/user-guide/aql/operators.html',
);
shellOpen(URL_ANNIMATE_USER_GUIDE);
}}
>
<ExternalLink className="mr-2 h-4 w-4" />
User Guide
<MenubarShortcut>F1</MenubarShortcut>
</MenubarItem>

<MenubarItem
onSelect={() => {
shellOpen(URL_AQL_OPERATORS);
}}
>
<ExternalLink className="mr-2 h-4 w-4" />
AQL operator reference
AQL Operators
</MenubarItem>

<MenubarSeparator />
Expand Down
9 changes: 9 additions & 0 deletions annimate_desktop/src/lib/urls.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const URL_ANNIMATE = 'https://github.com/matthias-stemmler/annimate';

export const URL_ANNIMATE_USER_GUIDE =
'https://matthias-stemmler.github.io/annimate/user-guide/';

export const URL_AQL_OPERATORS =
'https://korpling.github.io/ANNIS/4.0/user-guide/aql/operators.html';

export const URL_GRAPHANNIS = 'https://github.com/korpling/graphANNIS';
2 changes: 1 addition & 1 deletion release.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"versionBump": "none"
"versionBump": "minor"
}

0 comments on commit d200838

Please sign in to comment.