Skip to content

Commit 7fa7ac1

Browse files
committed
feat(CodeEditor): add onSearchBarAction prop with description for search functionality
feat(Helpers): update smoothScrollToTop easing function to use CUBIC_BEZIER_CURVE constant feat(constants): define CUBIC_BEZIER_CURVE constant for consistent animation easing
1 parent ac5ddc2 commit 7fa7ac1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/Shared/Components/CodeEditor/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ export type CodeEditorProps<DiffView extends boolean = false> = {
7979
diffView?: DiffView
8080
theme?: AppThemeType
8181
onOpenSearchPanel?: () => void
82+
/**
83+
* This method is triggered when user types something in the search/replace bar or applies a search or replace action.
84+
*/
8285
onSearchBarAction?: () => void
8386
} & CodeEditorPropsBasedOnDiffView<DiffView>
8487

src/Shared/Helpers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import {
5353
} from '../Common'
5454
import { getAggregator } from '../Pages'
5555
import { AggregatedNodes, PodMetadatum } from './Components'
56-
import { UNSAVED_CHANGES_PROMPT_MESSAGE } from './constants'
56+
import { CUBIC_BEZIER_CURVE, UNSAVED_CHANGES_PROMPT_MESSAGE } from './constants'
5757
import {
5858
AggregationKeys,
5959
BorderConfigType,
@@ -706,7 +706,7 @@ export const smoothScrollToTop = (scrollContainer: HTMLElement, targetPosition:
706706
const start = scrollContainer.scrollTop
707707

708708
const controls = animate(start, targetPosition, {
709-
ease: [0.33, 1, 0.68, 1],
709+
ease: CUBIC_BEZIER_CURVE,
710710
onUpdate: (value) => {
711711
scrollContainer.scrollTop = value
712712
},

src/Shared/constants.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,3 +580,4 @@ export const DEPLOYMENT_STAGE_TO_NODE_MAP: Readonly<Record<DeploymentStageType,
580580

581581
export const APP_DETAILS_FALLBACK_POLLING_INTERVAL = 30000
582582
export const PROGRESSING_DEPLOYMENT_STATUS_POLLING_INTERVAL = 10000
583+
export const CUBIC_BEZIER_CURVE: [number, number, number, number] = [0.33, 1, 0.68, 1]

0 commit comments

Comments
 (0)