diff --git a/pkg/interface/src/logic/lib/omnibox.js b/pkg/interface/src/logic/lib/omnibox.js index a00322350..1870db33f 100644 --- a/pkg/interface/src/logic/lib/omnibox.js +++ b/pkg/interface/src/logic/lib/omnibox.js @@ -11,19 +11,23 @@ const makeIndexes = () => new Map([ ]); // result schematic -const result = function(title, link, app, host) { +const result = function(title, link, app, host, description = 'Open', shiftLink = null, shiftDescription = null) { return { 'title': title, 'link': link, 'app': app, - 'host': host + 'host': host, + 'description': description, + 'shiftLink': shiftLink, + 'shiftDescription': shiftDescription + }; }; const shipIndex = function(contacts) { const ships = []; Object.keys(contacts).map((e) => { - return ships.push(result(e, `/~profile/${e}`, 'profile', contacts[e]?.status || '')); + return ships.push(result(e, `/~profile/${e}`, 'profile', contacts[e]?.status || '', 'Open Profile', `/~landscape/messages/dm/${e}`, 'Send Message')); }); return ships; }; diff --git a/pkg/interface/src/views/components/leap/Omnibox.tsx b/pkg/interface/src/views/components/leap/Omnibox.tsx index 5fdb1d9f1..c2500bf70 100644 --- a/pkg/interface/src/views/components/leap/Omnibox.tsx +++ b/pkg/interface/src/views/components/leap/Omnibox.tsx @@ -329,7 +329,7 @@ export function Omnibox(props: OmniboxProps): ReactElement { ); const sel = selected?.length ? selected[1] : ''; return ( - + {categoryTitle} {categoryResults.sort(sortResults).map((result, i2) => ( navigate(result.app, result.link, false)} @@ -366,9 +369,9 @@ export function Omnibox(props: OmniboxProps): ReactElement { > { diff --git a/pkg/interface/src/views/components/leap/OmniboxResult.tsx b/pkg/interface/src/views/components/leap/OmniboxResult.tsx index 8b1ce26ae..1f85914da 100644 --- a/pkg/interface/src/views/components/leap/OmniboxResult.tsx +++ b/pkg/interface/src/views/components/leap/OmniboxResult.tsx @@ -11,6 +11,22 @@ import useHarkState from '~/logic/state/hark'; import useLaunchState from '~/logic/state/launch'; import useInviteState from '~/logic/state/invite'; +function OmniboxResultChord(props: { + label: string; + modifier?: string; + +}) { + const { label, modifier } = props; + + return ( + + {label} + { modifier ? ({modifier}) : null} + + + ); +} + interface OmniboxResultProps { contacts: Contacts; cursor: string; @@ -24,6 +40,7 @@ interface OmniboxResultProps { setSelection: () => void; subtext: string; text: string; + shift?: string; } interface OmniboxResultState { @@ -230,7 +247,10 @@ export class OmniboxResult extends Component setSelection()} onMouseLeave={() => this.setHover(false)} @@ -259,6 +278,8 @@ export class OmniboxResult extends Component + - {subtext} + {(selected === link) ? ( + <> + + {(shiftLink && shiftDescription) ? () : null} + + ) : subtext} );