@@ -26,7 +26,7 @@ const updateHighlights = (newHighlights: Highlight[]) => {
2626 listeners . forEach ( ( listener ) => listener ( newHighlights ) ) ;
2727} ;
2828
29- // --- Public API ---
29+ // --- Public API ---
3030
3131/**
3232 * Adds a highlight box to be rendered by the overlay.
@@ -39,7 +39,7 @@ export const addHighlight = (
3939) => {
4040 // Create opacity animation value for fade effect
4141 const opacity = new Animated . Value ( 1 ) ;
42-
42+
4343 const newHighlight : Highlight = {
4444 id,
4545 ...layout ,
@@ -61,7 +61,7 @@ export const addHighlight = (
6161 // Remove highlights older than HIGHLIGHT_DURATION
6262 const now = Date . now ( ) ;
6363 const updatedHighlights = [
64- ...highlightsState . filter ( h => ( now - h . timestamp ) < HIGHLIGHT_DURATION ) ,
64+ ...highlightsState . filter ( ( h ) => now - h . timestamp < HIGHLIGHT_DURATION ) ,
6565 newHighlight ,
6666 ] ;
6767
@@ -72,7 +72,7 @@ export const addHighlight = (
7272 * Removes a specific highlight by ID
7373 */
7474const removeHighlight = ( id : string ) => {
75- const updatedHighlights = highlightsState . filter ( h => h . id !== id ) ;
75+ const updatedHighlights = highlightsState . filter ( ( h ) => h . id !== id ) ;
7676 if ( updatedHighlights . length !== highlightsState . length ) {
7777 updateHighlights ( updatedHighlights ) ;
7878 }
@@ -85,7 +85,7 @@ export const clearHighlights = () => {
8585 updateHighlights ( [ ] ) ;
8686} ;
8787
88- // --- Component ---
88+ // --- Component ---
8989
9090export const RenderOverlay : React . FC = ( ) => {
9191 const [ highlights , setHighlights ] = useState < Highlight [ ] > ( highlightsState ) ;
@@ -96,7 +96,7 @@ export const RenderOverlay: React.FC = () => {
9696 listeners . push ( setHighlights ) ;
9797 // Set initial state in case highlights were added before mount
9898 setHighlights ( highlightsState ) ;
99-
99+
100100 return ( ) => {
101101 mounted . current = false ;
102102 // Unsubscribe on unmount
@@ -105,7 +105,7 @@ export const RenderOverlay: React.FC = () => {
105105 } , [ ] ) ;
106106
107107 // On Android, measure() might give coordinates relative to the root view,
108- // on iOS, it might be relative to the window.
108+ // on iOS, it might be relative to the window.
109109 // `position: 'absolute'` without top/left defaults to 0,0 relative to parent,
110110 // which should work if the Overlay is rendered at the root.
111111 // Adjustments might be needed based on testing.
@@ -143,4 +143,4 @@ const styles = StyleSheet.create({
143143 borderWidth : 2 , // Make highlights visible
144144 backgroundColor : 'rgba(0, 0, 255, 0.05)' , // Optional: slight background tint
145145 } ,
146- } ) ;
146+ } ) ;
0 commit comments