<commit_before>package views

import (
	"github.com/davelondon/vecty"
	"github.com/davelondon/vecty/elem"
	"github.com/davelondon/vecty/event"
	"github.com/davelondon/vecty/prop"
	"golang.org/x/net/context"
	"kego.io/editor/client/actions"
	"kego.io/editor/client/models"
	"kego.io/editor/client/stores"
	"kego.io/flux"
)

type BranchControlView struct {
	*View

	model    *models.BranchModel
	children vecty.List
}

func NewBranchControlView(ctx context.Context, model *models.BranchModel) *BranchControlView {
	v := &BranchControlView{}
	v.View = New(ctx, v)
	v.model = model
	v.Watch(v.model,
		stores.BranchSelectControl,
		stores.BranchUnselectControl,
	)
	return v
}

// ke: {"func": {"notest": true}}
func (v *BranchControlView) Reconcile(old vecty.Component) {
	if old, ok := old.(*BranchControlView); ok {
		v.Body = old.Body
	}
	v.ReconcileBody()
	if v.model != nil && v.App.Branches.Selected() == v.model {
		v.focus()
	}
}

func (v *BranchControlView) Receive(notif flux.NotifPayload) {
	defer close(notif.Done)
	v.ReconcileBody()
	if v.model != nil && v.App.Branches.Selected() == v.model {
		v.focus()
	}
}<commit_msg>Node value change causes ancestor branch labels to redraw<commit_after>package views

import (
	"github.com/davelondon/vecty"
	"github.com/davelondon/vecty/elem"
	"github.com/davelondon/vecty/event"
	"github.com/davelondon/vecty/prop"
	"golang.org/x/net/context"
	"kego.io/editor/client/actions"
	"kego.io/editor/client/models"
	"kego.io/editor/client/stores"
	"kego.io/flux"
)

type BranchControlView struct {
	*View

	model    *models.BranchModel
	children vecty.List
}

func NewBranchControlView(ctx context.Context, model *models.BranchModel) *BranchControlView {
	v := &BranchControlView{}
	v.View = New(ctx, v)
	v.model = model
	v.Watch(v.model,
		stores.BranchSelectControl,
		stores.BranchUnselectControl,
	)
	if nci, ok := model.Contents.(models.NodeContentsInterface); ok {
		v.Watch(nci.GetNode(),
			stores.NodeDescendantValueChanged,
		)
	}
	return v
}

// ke: {"func": {"notest": true}}
func (v *BranchControlView) Reconcile(old vecty.Component) {
	if old, ok := old.(*BranchControlView); ok {
		v.Body = old.Body
	}
	v.ReconcileBody()
	if v.model != nil && v.App.Branches.Selected() == v.model {
		v.focus()
	}
}

func (v *BranchControlView) Receive(notif flux.NotifPayload) {
	defer close(notif.Done)
	v.ReconcileBody()
	if v.model != nil && v.App.Branches.Selected() == v.model {
		v.focus()
	}
}
{'fraction_non_alphanumeric': 0.15460122699386503, 'fraction_numerical': 0.0, 'mean_word_length': 4.282937365010799, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2120603', 'n_tokens_mistral': 984, 'n_tokens_neox': 979, 'n_words': 165}