File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -21,18 +21,22 @@ jobs:
2121 - name : Get branch name
2222 id : extract_branch
2323 run : |
24- echo "branch=${{ github.event.workflow_run.head_branch }}" >> $GITHUB_OUTPUT
24+ branch="${{ github.event.workflow_run.head_branch }}"
25+ # atlan/beta -> beta, atlan/main -> main (for atlan repo)
26+ echo "dispatch_branch=${branch#atlan/}" >> $GITHUB_OUTPUT
27+ # keep original branch for checkout in this repo
28+ echo "source_branch=${branch}" >> $GITHUB_OUTPUT
2529
2630 - uses : actions/checkout@v4
2731 with :
2832 token : ${{ secrets.ORG_PAT_GITHUB }}
29- ref : ${{ steps.extract_branch.outputs.branch }}
33+ ref : ${{ steps.extract_branch.outputs.source_branch }}
3034 fetch-depth : 0
3135
3236 - name : Get SHA of the branch
3337 id : get_sha
3438 run : |
35- branch_name=${{ steps.extract_branch.outputs.branch }}
39+ branch_name=${{ steps.extract_branch.outputs.source_branch }}
3640 sha=$(git rev-parse "refs/heads/$branch_name")
3741 echo "GIT_SHA: $sha"
3842 echo "sha=${sha}" >> $GITHUB_OUTPUT
6367 {
6468 "repo": {
6569 "name": "${{ steps.extract_repo_name.outputs.repo_name }}",
66- "branch": "${{ steps.extract_branch.outputs.branch }}",
70+ "branch": "${{ steps.extract_branch.outputs.dispatch_branch }}",
6771 "pr_url": "${{ steps.get_pr_url_user.outputs.pr_url }}",
6872 "pr_user": "${{ steps.get_pr_url_user.outputs.pr_user }}"
6973 }
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import { XMarkIcon } from '@heroicons/react/24/outline';
44export function Modal ( props ) {
55 const { stopHandler, navBar, children } = props ;
66 const logsEndRef = useRef ( null ) ;
7+ const scrollContainerRef = useRef ( null ) ;
8+ const isUserNearBottom = useRef ( true ) ;
79
810 useEffect ( ( ) => {
911 document . body . style . overflow = 'hidden' ;
@@ -13,9 +15,19 @@ export function Modal(props) {
1315 } , [ ] ) ;
1416
1517 useEffect ( ( ) => {
16- logsEndRef . current . scrollIntoView ( ) ;
18+ if ( isUserNearBottom . current ) {
19+ logsEndRef . current . scrollIntoView ( ) ;
20+ }
1721 } , [ children ] ) ;
1822
23+ const handleScroll = ( ) => {
24+ const container = scrollContainerRef . current ;
25+ if ( ! container ) return ;
26+ const threshold = 50 ;
27+ isUserNearBottom . current =
28+ container . scrollHeight - container . scrollTop - container . clientHeight < threshold ;
29+ } ;
30+
1931 return (
2032 < div
2133 className = "fixed flex inset-0 z-10 bg-gray-500 bg-opacity-75"
@@ -35,7 +47,7 @@ export function Modal(props) {
3547 </ button >
3648 </ div >
3749 < nav > { navBar } </ nav >
38- < div className = "h-full relative overflow-y-auto p-4 bg-slate-800 rounded-b-lg font-normal" >
50+ < div ref = { scrollContainerRef } onScroll = { handleScroll } className = "h-full relative overflow-y-auto p-4 bg-slate-800 rounded-b-lg font-normal" >
3951 { children }
4052 < p ref = { logsEndRef } />
4153 </ div >
You can’t perform that action at this time.
0 commit comments