Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
fa80eb4
Improve search results formatting for better readability and user exp…
devin-ai-integration[bot] May 6, 2025
95df69f
Fix TypeScript errors with CSS implementation in search results
devin-ai-integration[bot] May 6, 2025
9469d70
Add feature to clear search bar after clicking a result
devin-ai-integration[bot] May 6, 2025
a4f30b0
Fix linting issues in RegistrySearch component
devin-ai-integration[bot] May 6, 2025
52c032f
Implement command palette/spotlight search triggered by Cmd+K
devin-ai-integration[bot] May 6, 2025
7112ffa
Fix TypeScript errors in CommandPalette component
devin-ai-integration[bot] May 6, 2025
2d0c43b
Fix UI issues in command palette: prevent double scrollbars and impro…
devin-ai-integration[bot] May 6, 2025
3ed7f2d
Fix command palette overlay implementation and UI issues
devin-ai-integration[bot] May 6, 2025
04395f7
Remove unused EuiOverlayMask import
devin-ai-integration[bot] May 6, 2025
e8f2b87
Fix command palette UI issues and improve user experience
devin-ai-integration[bot] May 6, 2025
75bdaee
Fix command palette modal closing when clicking on search results
devin-ai-integration[bot] May 6, 2025
3bf4c83
Apply formatting to command palette components
devin-ai-integration[bot] May 6, 2025
c98a5b0
Use React Router navigation instead of window.location.href to preven…
devin-ai-integration[bot] May 6, 2025
fff8f06
Format CommandPalette.tsx and clean up code
devin-ai-integration[bot] May 6, 2025
087bfb6
Remove test button from Layout component
devin-ai-integration[bot] May 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply formatting to command palette components
Co-Authored-By: Francisco Javier Arceo <arceofrancisco@gmail.com>
  • Loading branch information
commit 3bf4c839a9f2a877346767129829d5c93cdb7a0f
46 changes: 26 additions & 20 deletions ui/src/components/CommandPalette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const commandPaletteStyles: Record<string, React.CSSProperties> = {
zIndex: 9999,
display: "flex",
alignItems: "center",
justifyContent: "center"
justifyContent: "center",
},
modal: {
width: "600px",
Expand All @@ -38,40 +38,40 @@ const commandPaletteStyles: Record<string, React.CSSProperties> = {
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
overflow: "hidden",
display: "flex",
flexDirection: "column"
flexDirection: "column",
},
modalHeader: {
padding: "16px",
borderBottom: "1px solid #D3DAE6",
position: "sticky",
top: 0,
backgroundColor: "white",
zIndex: 1
zIndex: 1,
},
modalBody: {
padding: "0 16px 16px",
maxHeight: "calc(80vh - 60px)",
overflowY: "auto"
overflowY: "auto",
},
searchResults: {
marginTop: "8px"
marginTop: "8px",
},
categoryGroup: {
marginBottom: "8px"
marginBottom: "8px",
},
searchResultItem: {
padding: "8px 0",
borderBottom: "1px solid #eee"
borderBottom: "1px solid #eee",
},
searchResultItemLast: {
padding: "8px 0",
borderBottom: "none"
borderBottom: "none",
},
itemDescription: {
fontSize: "0.85em",
color: "#666",
marginTop: "4px"
}
marginTop: "4px",
},
};

interface CommandPaletteProps {
Expand Down Expand Up @@ -161,18 +161,20 @@ const CommandPalette: React.FC<CommandPaletteProps> = ({
};
});

console.log("CommandPalette isOpen:", isOpen, "categories:", categories.length); // Debug log
console.log(
"CommandPalette isOpen:",
isOpen,
"categories:",
categories.length,
); // Debug log

if (!isOpen) {
console.log("CommandPalette not rendering due to isOpen=false");
return null;
}

return (
<div
style={commandPaletteStyles.overlay}
onClick={onClose}
>
<div style={commandPaletteStyles.overlay} onClick={onClose}>
<div
style={commandPaletteStyles.modal}
onClick={(e) => e.stopPropagation()}
Expand All @@ -181,9 +183,7 @@ const CommandPalette: React.FC<CommandPaletteProps> = ({
<div style={commandPaletteStyles.modalHeader}>
<h2 style={{ margin: 0 }}>Search Registry</h2>
</div>
<div
style={commandPaletteStyles.modalBody}
>
<div style={commandPaletteStyles.modalBody}>
<EuiFieldSearch
placeholder="Search across Feature Views, Features, Entities, etc."
value={searchText}
Expand All @@ -204,7 +204,10 @@ const CommandPalette: React.FC<CommandPaletteProps> = ({
searchResults
.filter((result) => result.items.length > 0)
.map((result) => (
<div key={result.title} style={commandPaletteStyles.categoryGroup}>
<div
key={result.title}
style={commandPaletteStyles.categoryGroup}
>
<EuiPanel hasBorder={true} paddingSize="m">
<EuiTitle size="xs">
<h3>
Expand Down Expand Up @@ -233,7 +236,10 @@ const CommandPalette: React.FC<CommandPaletteProps> = ({
window.location.href = item.link;
}, 50);
}}
style={{ color: '#0077cc', textDecoration: 'none' }}
style={{
color: "#0077cc",
textDecoration: "none",
}}
>
<strong>{item.name}</strong>
</a>
Expand Down
9 changes: 8 additions & 1 deletion ui/src/components/GlobalSearchShortcut.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ const GlobalSearchShortcut: React.FC<GlobalSearchShortcutProps> = ({
}) => {
useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
console.log("Key pressed:", event.key, "metaKey:", event.metaKey, "ctrlKey:", event.ctrlKey);
console.log(
"Key pressed:",
event.key,
"metaKey:",
event.metaKey,
"ctrlKey:",
event.ctrlKey,
);
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
console.log("Cmd+K detected, preventing default and calling onOpen");
event.preventDefault();
Expand Down
16 changes: 13 additions & 3 deletions ui/src/pages/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,17 @@ const Layout = () => {
setIsCommandPaletteOpen(true);
console.log("Command palette state should be updated to true");
};

useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
console.log("Layout key pressed:", event.key, "metaKey:", event.metaKey, "ctrlKey:", event.ctrlKey);
console.log(
"Layout key pressed:",
event.key,
"metaKey:",
event.metaKey,
"ctrlKey:",
event.ctrlKey,
);
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
console.log("Layout detected Cmd+K, preventing default");
event.preventDefault();
Expand Down Expand Up @@ -164,7 +171,10 @@ const Layout = () => {
style={{ width: "600px", maxWidth: "90%" }}
>
<RegistrySearch ref={searchRef} categories={categories} />
<button onClick={handleSearchOpen} style={{ marginTop: "10px" }}>
<button
onClick={handleSearchOpen}
style={{ marginTop: "10px" }}
>
Open Command Palette (Test)
</button>
</EuiFlexItem>
Expand Down