& {
) => ReactNode;
renderCategoryItemGroupHeader?: (props: ItemHeaderProps) => ReactNode;
renderCategoryItem?: (props: CategoryItemProps) => ReactNode;
+ showHiddenItems?: boolean;
};
export function CategoryAutocomplete({
@@ -114,6 +134,7 @@ export function CategoryAutocomplete({
renderSplitTransactionButton,
renderCategoryItemGroupHeader,
renderCategoryItem,
+ showHiddenItems,
...props
}: CategoryAutocompleteProps) {
const categorySuggestions: Array<
@@ -167,6 +188,7 @@ export function CategoryAutocomplete({
renderSplitTransactionButton={renderSplitTransactionButton}
renderCategoryItemGroupHeader={renderCategoryItemGroupHeader}
renderCategoryItem={renderCategoryItem}
+ showHiddenItems={showHiddenItems}
/>
)}
{...props}
@@ -268,6 +290,7 @@ type CategoryItemProps = {
export function CategoryItem({
item,
className,
+ style,
highlighted,
embedded,
...props
@@ -275,6 +298,7 @@ export function CategoryItem({
const { isNarrowWidth } = useResponsive();
return (
{item.name}
+ {item.hidden ? ' (hidden)' : null}
);
}
diff --git a/packages/desktop-client/src/components/autocomplete/ItemHeader.tsx b/packages/desktop-client/src/components/autocomplete/ItemHeader.tsx
index 981c05bec26..7367280857f 100644
--- a/packages/desktop-client/src/components/autocomplete/ItemHeader.tsx
+++ b/packages/desktop-client/src/components/autocomplete/ItemHeader.tsx
@@ -1,5 +1,7 @@
import React from 'react';
+import { type CategoryGroupEntity } from 'loot-core/types/models/category-group';
+
import { theme } from '../../style/theme';
import { type CSSProperties } from '../../style/types';
@@ -7,9 +9,16 @@ export type ItemHeaderProps = {
title: string;
style?: CSSProperties;
type?: string;
+ item?: CategoryGroupEntity;
};
-export function ItemHeader({ title, style, type, ...props }: ItemHeaderProps) {
+export function ItemHeader({
+ title,
+ style,
+ type,
+ item,
+ ...props
+}: ItemHeaderProps) {
return (
{title}
+ {item?.hidden ? ' (hidden)' : null}
);
}
diff --git a/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx b/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx
index 2f33e371f7d..6ac8a4ab6ba 100644
--- a/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx
+++ b/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx
@@ -58,6 +58,7 @@ export function CoverTooltip({
}
},
}}
+ showHiddenItems={false}
/>
)}
diff --git a/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx b/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx
index 0d27946f138..7806d7ce3df 100644
--- a/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx
+++ b/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx
@@ -101,6 +101,7 @@ export function TransferTooltip({
onUpdate={() => {}}
onSelect={id => setCategory(id)}
inputProps={{ onEnter: submit, placeholder: '(none)' }}
+ showHiddenItems={true}
/>
{categoryError && (
diff --git a/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.tsx b/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.tsx
index a448f351ca0..6602febd308 100644
--- a/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.tsx
+++ b/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.tsx
@@ -113,6 +113,7 @@ export function ConfirmCategoryDelete({
placeholder: 'Select category...',
}}
onSelect={category => setTransferCategory(category)}
+ showHiddenItems={true}
/>
diff --git a/packages/desktop-client/src/components/modals/EditField.jsx b/packages/desktop-client/src/components/modals/EditField.jsx
index 5b2b4d70b5a..22e2a9f8fdb 100644
--- a/packages/desktop-client/src/components/modals/EditField.jsx
+++ b/packages/desktop-client/src/components/modals/EditField.jsx
@@ -249,6 +249,7 @@ export function EditField({ modalProps, name, onSubmit, onClose }) {
),
})}
{...autocompleteProps}
+ showHiddenItems={false}
/>
);
break;
diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx
index 89ca9550ba2..c5e853fa5cd 100644
--- a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx
+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx
@@ -1281,6 +1281,7 @@ const Transaction = memo(function Transaction(props) {
onUpdate={onUpdate}
onSelect={onSave}
menuPortalTarget={undefined}
+ showHiddenItems={false}
/>
)}
diff --git a/packages/desktop-client/src/components/util/GenericInput.jsx b/packages/desktop-client/src/components/util/GenericInput.jsx
index 3c46d3a4315..84b769cc45c 100644
--- a/packages/desktop-client/src/components/util/GenericInput.jsx
+++ b/packages/desktop-client/src/components/util/GenericInput.jsx
@@ -85,6 +85,7 @@ export function GenericInput({
multi={multi}
openOnFocus={true}
onSelect={onChange}
+ showHiddenItems={false}
inputProps={{
inputRef,
...(showPlaceholder ? { placeholder: 'nothing' } : null),
diff --git a/upcoming-release-notes/2429.md b/upcoming-release-notes/2429.md
new file mode 100644
index 00000000000..4a0747e53bb
--- /dev/null
+++ b/upcoming-release-notes/2429.md
@@ -0,0 +1,6 @@
+---
+category: Enhancements
+authors: [Shazib, carkom]
+---
+
+Hide hidden categories on the Category AutoComplete. Allow a prop for showing (with indication).