Skip to content

Commit fc685b2

Browse files
fix: address Copilot review comments on JSDoc and hook return shape
1 parent 9a96c0b commit fc685b2

5 files changed

Lines changed: 4 additions & 23 deletions

File tree

src/components/LHNOptionsList/OptionRowLHN/OptionRow/Subtitle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type SubtitleProps = {
1515
/** Option data for the row. Source of `alternateText` and emoji rendering hints. */
1616
optionItem: OptionData;
1717

18-
/** Display density mode. Compact rows hide the subtitle entirely. */
18+
/** Display density mode. Compact rows render the subtitle with compact styles; the subtitle is hidden only when `optionItem.alternateText` is empty. */
1919
viewMode: OptionMode;
2020

2121
/** Whether the row is the currently focused/active option. Drives the active text style. */

src/components/LHNOptionsList/OptionRowLHN/OptionRow/Title.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type TitleProps = {
1414
/** Whether the row is the currently focused/active option. Drives the active text style. */
1515
isOptionFocused: boolean;
1616

17-
/** Numeric testID for the title node (mirrors `reportID`). */
17+
/** Numeric testID for the title node. This is the FlashList row index passed in from the renderItem callback, not the report ID. */
1818
testID: number;
1919
};
2020

src/components/LHNOptionsList/OptionRowLHN/OptionRowLHNData.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import OptionRowLHN from './OptionRowLHN';
2525
/*
2626
* This component gets the data from onyx for the actual
2727
* OptionRowLHN component.
28-
* The OptionRowLHN component is memoized, so it will only
29-
* re-render if the data really changed.
28+
* OptionRowLHN is auto-memoized by React Compiler, so it will
29+
* only re-render when the inputs derived from this wrapper change.
3030
*/
3131
function OptionRowLHNData({
3232
isOptionFocused = false,

src/components/LHNOptionsList/OptionRowLHN/useOptionRowChrome.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ function useOptionRowChrome({isOptionFocused, viewMode}: UseOptionRowChromeParam
5151
}
5252

5353
return {
54-
hovered,
5554
setHovered,
5655
sidebarInnerRowStyle,
5756
contentContainerStyles,

tests/unit/hooks/useOptionRowChrome.test.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,6 @@ jest.mock('@hooks/useStyleUtils', () => ({
4242
}));
4343

4444
describe('useOptionRowChrome', () => {
45-
describe('hover state', () => {
46-
it('initialises hovered to false', () => {
47-
const {result} = renderHook(() => useOptionRowChrome({isOptionFocused: false, viewMode: CONST.OPTION_MODE.DEFAULT}));
48-
49-
expect(result.current.hovered).toBe(false);
50-
});
51-
52-
it('setHovered(true) toggles hovered to true', () => {
53-
const {result} = renderHook(() => useOptionRowChrome({isOptionFocused: false, viewMode: CONST.OPTION_MODE.DEFAULT}));
54-
55-
act(() => {
56-
result.current.setHovered(true);
57-
});
58-
59-
expect(result.current.hovered).toBe(true);
60-
});
61-
});
62-
6345
describe('avatarBackgroundColor precedence', () => {
6446
it('returns the default sidebar color when neither focused nor hovered', () => {
6547
const {result} = renderHook(() => useOptionRowChrome({isOptionFocused: false, viewMode: CONST.OPTION_MODE.DEFAULT}));

0 commit comments

Comments
 (0)