File tree Expand file tree Collapse file tree 3 files changed +26
-12
lines changed
src/main/frontend/pipeline-console-view/pipeline-console/main Expand file tree Collapse file tree 3 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -35,18 +35,14 @@ export const ConsoleLine = memo(function ConsoleLine(props: ConsoleLineProps) {
3535 className = "console-output-line"
3636 key = { `console-line-pre${ props . lineNumber } ` }
3737 >
38- < div
39- className = "console-output-line-anchor"
40- id = { `log-${ props . lineNumber } ` }
41- key = { `${ props . lineNumber } -anchor` }
42- />
4338 < div
4439 className = "console-output-line"
4540 key = { `${ props . lineNumber } -body` }
4641 ref = { ref }
4742 >
4843 < a
4944 className = "console-line-number"
45+ id = { `log-${ props . lineNumber } ` }
5046 href = { `?start-byte=${ props . startByte } &selected-node=${ props . stepId } #log-${ props . lineNumber } ` }
5147 style = { {
5248 width : Math . max ( 9 * String ( props . lineNumber ) . length , 30 ) + "px" ,
Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ export default function ConsoleLogStream(props: ConsoleLogStreamProps) {
8181 const element = document . getElementById ( `log-${ lineNumber } ` ) ;
8282 if ( element ) {
8383 element . scrollIntoView ( { behavior : "smooth" , block : "center" } ) ;
84+ const hash = location . hash ;
85+ location . hash = "" ;
86+ location . hash = hash ;
8487 }
8588 }
8689 } , [ ] ) ;
Original file line number Diff line number Diff line change @@ -124,25 +124,39 @@ pre.console-output-line {
124124
125125a .console-line-number {
126126 text-align : right ;
127- margin-right : 14 px ;
127+ margin-right : 0.875 rem ;
128128 color : var (--text-color-secondary );
129129 white-space : nowrap ;
130130 display : inline-block ;
131131 flex-shrink : 0 ;
132132 user-select : none ;
133- }
133+ outline : none ;
134134
135- div .console-output-line-anchor {
136- position : relative ;
137- // This is the width of the '.jenkins-breadcrumbs' div + a little extra.
138- top : -50px ;
139- visibility : hidden ;
135+ & :target {
136+ text-decoration : none ;
137+ scroll-margin-top : calc (var (--pgv-header-height ) + 3.4375rem );
138+ }
140139}
141140
142141div .console-output-line {
143142 position : relative ;
144143 display : flex ;
145144 padding-block : 2px ;
145+ z-index : 0 ;
146+
147+ & :has (:target ) {
148+ & ::before {
149+ background-color : color-mix (
150+ in srgb ,
151+ var (--blue ) 15% ,
152+ transparent
153+ ) !important ;
154+ // TODO - var fallback can removed after baseline is moved >= 2.496
155+ border : var (--jenkins-border-width , 2px ) solid
156+ color-mix (in srgb , var (--blue ) 10% , transparent );
157+ opacity : 1 ;
158+ }
159+ }
146160
147161 & ::before {
148162 content : " " ;
@@ -160,6 +174,7 @@ div.console-output-line {
160174 opacity : 0 ;
161175 transition : opacity var (--standard-transition );
162176 pointer-events : none ;
177+ z-index : -1 ;
163178 }
164179
165180 & :hover {
You can’t perform that action at this time.
0 commit comments