@@ -186,7 +186,7 @@ export class GlTimelineApp extends GlApp<State> {
186186 < gl-button
187187 appearance ="toolbar "
188188 density ="compact "
189- @click =${ this . onUpdateScope }
189+ @click =${ this . onChangeScope }
190190 tooltip ="Visualize Repository History ${ repo . name } "
191191 aria-label="Visualize Repository History ${ repo . name } "
192192 > ${ repo . name } </ gl-button
@@ -240,7 +240,7 @@ export class GlTimelineApp extends GlApp<State> {
240240 >
241241 < gl-button
242242 appearance ="toolbar "
243- @click =${ this . onUpdateScope }
243+ @click =${ this . onChangeScope }
244244 tooltip ="Visualize Folder History ${ rootPart } "
245245 aria-label="Visualize Folder History ${ rootPart } "
246246 > ${ rootPart } </ gl-button
@@ -256,7 +256,7 @@ export class GlTimelineApp extends GlApp<State> {
256256 >
257257 < gl-button
258258 appearance ="toolbar "
259- @click =${ this . onUpdateScope }
259+ @click =${ this . onChangeScope }
260260 tooltip ="Visualize Folder History ${ fullPath } "
261261 aria-label="Visualize Folder History ${ fullPath } "
262262 > ${ part } </ gl-button
@@ -350,40 +350,61 @@ export class GlTimelineApp extends GlApp<State> {
350350 config : { showAllBranches } ,
351351 } = this ;
352352 return html `< section >
353- < label for ="head " ?disabled =${ showAllBranches } > Head </ label >
353+ < label for ="head " ?disabled =${ showAllBranches } > Branch </ label >
354354 < gl-ref-button
355355 name ="head "
356356 ?disabled =${ showAllBranches }
357357 icon
358- tooltip ="Change Head Reference "
358+ tooltip ="Change Reference "
359359 .ref =${ head }
360360 location ="config"
361361 @click=${ this . onChooseHeadRef }
362362 > </ gl-ref-button >
363363 </ section > ` ;
364+
365+ // Commenting out for now, until base is ready
366+
367+ // const {
368+ // head,
369+ // config: { showAllBranches },
370+ // } = this;
371+ // return html`<section>
372+ // <label for="head" ?disabled=${showAllBranches}>Head</label>
373+ // <gl-ref-button
374+ // name="head"
375+ // ?disabled=${showAllBranches}
376+ // icon
377+ // tooltip="Change Head Reference"
378+ // .ref=${head}
379+ // location="config"
380+ // @click =${this.onChooseHeadRef}
381+ // ></gl-ref-button>
382+ // </section>`;
364383 }
365384
366385 private renderConfigBase ( ) {
367- if ( this . repository ?. virtual ) return nothing ;
368-
369- const {
370- head,
371- base,
372- config : { showAllBranches } ,
373- } = this ;
374- return html `< section >
375- < label for ="base " ?disabled =${ showAllBranches } > Base</ label >
376- < gl-ref-button
377- name ="base "
378- ?disabled =${ showAllBranches }
379- icon
380- tooltip ="Change Base Reference "
381- .ref =${ base ?. ref === head ?. ref ? undefined : base }
382- location ="config"
383- @click=${ this . onChooseBaseRef }
384- > < span slot ="empty "> <choose base></ span > </ gl-ref-button
385- >
386- </ section > ` ;
386+ // Commenting out for now, as its not yet ready
387+ return nothing ;
388+ // if (this.repository?.virtual) return nothing;
389+
390+ // const {
391+ // head,
392+ // base,
393+ // config: { showAllBranches },
394+ // } = this;
395+ // return html`<section>
396+ // <label for="base" ?disabled=${showAllBranches}>Base</label>
397+ // <gl-ref-button
398+ // name="base"
399+ // ?disabled=${showAllBranches}
400+ // icon
401+ // tooltip="Change Base Reference"
402+ // .ref=${base?.ref === head?.ref ? undefined : base}
403+ // location="config"
404+ // @click =${this.onChooseBaseRef}
405+ // ><span slot="empty"><choose base></span></gl-ref-button
406+ // >
407+ // </section>`;
387408 }
388409
389410 private renderConfigShowAllBranches ( ) {
@@ -488,7 +509,7 @@ export class GlTimelineApp extends GlApp<State> {
488509 return html `< span class ="details__timeframe " tabindex ="0 "> ${ label } </ span > ` ;
489510 }
490511
491- private onChooseBaseRef = async ( e : Event ) => {
512+ private onChooseBaseRef = async ( e : MouseEvent ) => {
492513 if ( ( e . target as GlRefButton ) . disabled ) return ;
493514
494515 const result = await this . _ipc . sendRequest ( ChooseRefRequest , { scope : this . scope ! , type : 'base' } ) ;
@@ -497,7 +518,7 @@ export class GlTimelineApp extends GlApp<State> {
497518 this . _ipc . sendCommand ( UpdateScopeCommand , { scope : this . scope ! , changes : { base : result . ref } } ) ;
498519 } ;
499520
500- private onChooseHeadRef = async ( e : Event ) => {
521+ private onChooseHeadRef = async ( e : MouseEvent ) => {
501522 if ( ( e . target as GlRefButton ) . disabled ) return ;
502523
503524 const location = ( e . target as GlRefButton ) . getAttribute ( 'location' ) ;
@@ -521,7 +542,7 @@ export class GlTimelineApp extends GlApp<State> {
521542 }
522543 } ;
523544
524- private onChoosePath = async ( e : Event ) => {
545+ private onChoosePath = async ( e : MouseEvent ) => {
525546 e . stopImmediatePropagation ( ) ;
526547 if ( this . repository == null || this . scope == null ) return ;
527548
@@ -536,10 +557,11 @@ export class GlTimelineApp extends GlApp<State> {
536557 this . _ipc . sendCommand ( UpdateScopeCommand , {
537558 scope : this . scope ,
538559 changes : { type : result . picked . type , relativePath : result . picked . relativePath } ,
560+ altOrShift : e . altKey || e . shiftKey ,
539561 } ) ;
540562 } ;
541563
542- private onUpdateScope = ( e : Event ) => {
564+ private onChangeScope = ( e : MouseEvent ) => {
543565 const el =
544566 ( e . target as HTMLElement ) ?. closest ( 'gl-breadcrumb-item-child' ) ??
545567 ( e . target as HTMLElement ) ?. closest ( 'gl-breadcrumb-item' ) ;
@@ -548,14 +570,22 @@ export class GlTimelineApp extends GlApp<State> {
548570 if ( type == null ) return ;
549571
550572 if ( type === 'repo' ) {
551- this . _ipc . sendCommand ( UpdateScopeCommand , { scope : this . scope ! , changes : { type : 'repo' } } ) ;
573+ this . _ipc . sendCommand ( UpdateScopeCommand , {
574+ scope : this . scope ! ,
575+ changes : { type : 'repo' } ,
576+ altOrShift : e . altKey || e . shiftKey ,
577+ } ) ;
552578 return ;
553579 }
554580
555581 const value = el ?. getAttribute ( 'value' ) ;
556582 if ( value == null ) return ;
557583
558- this . _ipc . sendCommand ( UpdateScopeCommand , { scope : this . scope ! , changes : { type : type , relativePath : value } } ) ;
584+ this . _ipc . sendCommand ( UpdateScopeCommand , {
585+ scope : this . scope ! ,
586+ changes : { type : type , relativePath : value } ,
587+ altOrShift : e . altKey || e . shiftKey ,
588+ } ) ;
559589 } ;
560590
561591 private onChartCommitSelected ( e : CustomEvent < CommitEventDetail > ) {
0 commit comments