►
From YouTube: FE Pairing - 20220902 - Changing the top nav view model
Description
In this session we dive into how we can adjust our top nav ViewModel builder to satisfy some new UX requirements.
A
I
don't
have
anything
open
that
shouldn't
be,
but
okay
should
be
fine
anyway
yeah.
So
basically
they
would
like
to
take
the
menu
here
and
kind
of
reorganize
and
remove
some
options
that
are
less
frequently
used
into
groups,
so
we've
got
switch
to
explore
and
your
dashboards.
A
There
are
some
mock-ups
here
in
from,
I
guess,
there's
just
screenshots
of
sigma.
I
think
you
can
see
the
the
you
know
the
bold
header
thing
here
so
I've
been
looking
at.
It
looks
like
code
that
you
touched
like
18
months
ago
or
something
that
generates
all
this.
It's
just
kind
of
a
json
blob,
that's
fed
to
the
front
end.
Do
you,
I
guess
I
was
gonna,
ask
for
your
advice
on
how
you
would
approach
changing
the
code.
A
That's
there
to
do
this
without
I
don't
rewrite
the
whole
thing
yeah.
I
assume
I
see
you
have
like
a
primary
and
secondary
kind
of
bucket
of
of
I
guess,
menu
items
that
that
get
added
to
here.
I
think
the
secondary
was
just
used
for
like
the
admin
yeah
yeah.
I
was
thinking
of
just
breaking
that
down
further
into
buckets
for
each
of
these
headers.
B
The
the
intense
the
intent
with
the
way
we
we
set
it
up
was
that
the
back
end
had
all
the
information
for
when
we
want
to
hide
and
show
these
things
right.
So,
let's,
let's
back
and
build
that
model,
but
let's
let
it
build
it
in
such
a
way
that
it's
actually
helpful
to
the
view.
So
it's
like,
so
I
would
classify
this
as
a
view
model,
so
it
doesn't
have
to
be
like
a
like
very
denormalized
state
thing.
It's
like
this
is
a
presentation
model
that
we're
just
gonna
give
to
the
view.
B
B
A
Yeah-
and
that
makes
sense-
I'm
not
sure
how
it
currently
works,
I
mean:
does
it
currently
just
read
it
in
order
and
place
the
menus
and
the
options
in
the
same
order
that
they're
they're
given
yeah?
What
we
would
be
doing
is
kind
of
like
taking
an
array
and
collating
set
the
right
word,
just
organizing
them
by
some
sub
property
before
rendering.
B
So
I
think,
I
think,
that's
an
option.
I
was
even
thinking
even
simpler
than
that.
So,
like
my
the
I,
the
suggestion
I
would
give
is
like,
let's
try
to
have
the
front
end,
do
as
little
as
possible,
okay,
and
so
what?
If
the
back
end?
What?
If
that
array
where
it
was
getting
where
we
had
a
list
of
like
primary
menu
items,
I
guess.
B
B
A
Another
thing,
I'm
not
sure
if
they
accounted
for
all
of
the
possible
options
in
this
design.
Now
that
I'm
looking
at
it,
I
know
there's
some
that
are
kind
of
conditionally
hidden
like
the
geo
options,
yeah.
Obviously
the
admin
stuff
there's
a
lot
of
options
there
yeah
and
I'm
not
sure
presume
that
goes
under
your
dashboards
or
maybe
just
at
the
bottom,
under
a
divider
like
it
probably
is
now
so
yeah.
C
Thinking
of
it
would
be
super
cool
if
we
had
like
a
back-end
feature
flag
that
we
can
set
in
development
to
just
show
all
options
right
like
so
that
the
designers
would
be
able
to
see
it.
That's
a
good
idea.
It's
a
good.
A
B
B
B
Okay,
the
easiest
way
I
can
I
can
see
this
happening
is
rather
than
actually
creating
a
view
model
that
has
some
sort
of
nesting
structure.
Yeah.
Let's
just
create
one
flat
list,
but
in
the
list
we
have
separators
type
yeah,
we
say:
here's
the
header
type,
here's
the
item
type
and
we
just
that
just
sounds
the
easiest
to
me.
C
And
so
you,
you
would,
for
example,
have
the
back
end.
Also
you
have
it
fully
tested
like
conditionally,
like
if
you're,
not
locked
in
you,
don't
get
the
thing
and
so
on.
Right,
like.
A
C
I
always
can
you,
can
you
go
to
the
design
you
just
had?
I'm
I'm
always
a
little
confused.
You
know
yeah.
This
is
the.
C
C
Yeah,
this
is,
for
example,
funny
right
like
an
anonymous
explorer,
has
projects
groups
and
snippets,
and
then
you
go
back
logged
in
it
is
switched
to
projects
and
groups
right
yeah
like
the
oh,
that
yeah
it's.
A
A
Yeah,
if
you're
logged
in
you're,
probably
not
going
to
be
exploring
as
much
if
you
do,
I
suppose
it's
this
you
all
projects
would
do
the
equivalent
of
clicking
that,
on
the
signed
in
button.
C
A
A
I
didn't
dig
deep
enough
to
check,
but
I
know
you
can
disable
snippets.
I
wasn't
sure
if
you
could
disable
exploring
projects
and
groups.
B
Is
only
admin
pages,
it's
there's
no
project
clips
or
snippets.
You
can
just
visit
the
admin
page.
The
other
other
thing,
I'm
not
seeing
in
these
designs
is
the
responsive
menu.
So
one
of
the
big
wins
of
doing
this
view
model
approach
also
means
we
use
the
exact
same
model
for
building
the
responsive
presentation.
Oh
the
you.
B
A
Mobile
view
yeah
yeah,
I
don't
know
if
that's
touched
on,
I
imagine
we'll
be
leaving
that
alone
for
the
purposes
of
this,
and
I'm
not
sure
if
adding
these
headers
is
going
to
conflict.
With
that
I
know
the
responsive
menu
is
generated.
Is
it
generated
by
the
same
ruby
class
or
is
it
a
separate.
B
Yeah,
it's
the
same.
It's
the
same
view
model
the,
and
so
if
we
went
with
the
approach
of
a
flat
list
with
a
type,
we
would
just.
C
A
Let's
do
it
close
out
of
all
the
stuff
I
have
open
here.
Actually,
this
might
be
where
we
need
to
be.
C
So
here
we
would
probably
create
do
something
like
add
primary
menus
separator
or
something
like
this
right.
A
C
C
B
A
A
A
And
yeah,
what's
this
great
new
project
exactly
right,
so
is.
B
B
You
go
to
the
top
nav
menu
item
class.
We
probably
just
want
to
throw
a
type
in
there.
C
B
C
A
That
makes
more
sense,
so
should
I
have
type
well,
I
don't
know
because
it
is
a
menu
wait
is,
is
it.
B
B
B
B
A
Sense,
just
duplicate
file,
option.
C
B
C
A
B
A
B
B
B
Oh,
oh
gosh!
Oh
that's
so
funny!
So
this
this
view
model
is
also
used
for
the
this
is
also
used
for
the
new
drop
down
it.
Doesn't
we
don't
use
emojis
in
the
top
menu,
but
on
the
plus.
A
A
B
C
So
if
this
is
going
to
be,
serialized
is
the.
How
is
it
called?
Is
this
symbol?
It's
a
symbol.
Right
is
the
symbol
going
to
be
changed
to
a
string.
B
Yeah
they
get
stringified.
Okay,.
A
Good
yeah,
I
think
I
think
that's
what
happens.
I
guess
we
could
find
out,
but
I
guess
you
know
I
could
just
make
it
a
string
here
anyway.
B
B
So
the
top,
what
I
think
we'd
want
to
have
here-
yes
add
primary
menu
header.
Yes,
yes,.
A
C
A
Sorry,
I'm
losing
track
of
where
I
am
yeah.
So
this
oh
yeah,
that's
right.
I
was
thinking
that
that
was
in
the
subclass
or
the
builder
class.
Whatever
the
class
is.
B
B
B
All
right
and
then
line
39
will
change
the
top
menu
header
yeah.
A
B
If
you
go
to,
I
think
it's
new
drop
down,
yeah
new
dot
drop
down,
html
hammel.
It
has
the
leading
underscore
yeah
yeah.
A
A
A
What
property
we're
looking
at
here,
many
sections.
B
So
so
go
back
go
back
to
the
new
drop
down
helper!
Please
the
it's
in
the
far
right,
the
oh
yeah!
So
we
create
these
menu
sections.
B
B
A
B
Yeah,
that's
that's
fair
now,
but
now
I'm
thinking
about
it
I'm
like
well.
Maybe
we
do
need
to
do
this
because.
A
C
I
mean
the
rendering
you
the
thing
is:
how
do
we
want
the
data?
I
think
flat.
Data
with
the
heading
is
good
because
in
the
end,
you
still
could
change
the
rendering
to
run
multiple
ul's
like
hey.
If
you
encounter
a
heading
close
existing
ul
start
a
new
ul
right
like
you
could
do
that
as
well
and
I'm
a
proponent
of
flat
data.
I
potentially
would
refactor
the
right
hand
side
to
be
flit
data
as
well
right.
You
know,
yeah.
A
I
think
that
makes
sense
either
way.
I
think
they
should
both
be.
You
know,
rendered
from
the
back
end
in
the
same
way
just
for
consistency.
So
maybe
we
go
with
what
we
were
talking
about.
What
we're
in
the
middle
of
implementing
here
with
the
the
flat
headers
and
I'll,
create
a
separate
issue
to
go
back
and
kind
of
refactor
this
to
use
that
same
method.
B
A
All
right,
where
was
I
here?
So
how
does
this
say?
It's
changed
all
right
that
we
added,
and
this
is
simple,
so
I
guess
the
reason
we
were
exploring
that
originally
was
to
make
sure
that
we
won't
break
anything
by
adding.
I
don't
think
we
would
be.
C
I
mean
in
the
end,
the
whole
thing
is
just
an
array
right
that
gets
rendered
to
json,
and
it
has
like
a
little
bit
of
types
right.
Yeah.
A
Yeah
and
it's
it's
not
gonna
include
any
of
the
headers
in
that
one,
since
we
we're
only
adding
it
to
this
one,
so
yeah
shouldn't
get
choked
up
or
confused
so.
B
A
B
B
If
we
go
to
the
view
model,
the
top
nav
view
model
builder.
A
B
B
C
B
So
so
the
way
I
see
this
being
used,
one
of
the
benefits
you
get
with
the
menu
items
approach
is,
I
can
tell
does.
Does
this
section?
Have
no
items,
therefore,
don't
create
the
header
like
just
remove
the
whole
thing
yeah
when
we
go
to
that
helper,
the
top
nav
helper.
I
have
an
idea
for
how
to
fix
this,
but
if
we
go
to
the
top
nav
helper.
C
B
What
what
I
was
thinking-
oh
that's,
a
that's
an
interesting
idea.
I
was
I
was
thinking
potentially
something.
Maybe
less
performant,
but
maybe
more
okay,
going
back
more
elegant
would
be,
let's
just
always
add
the
header
and
at
the
very
end,
we'll
clean
up
headers
that
that
don't
have
items
following
them
and
you
can
actually.
C
B
Yeah
yeah,
so
as
long
if
it
doesn't
have
an
item
after
it,
you
remove
it
so
like
we
could,
just
we
always
add
it,
but
then,
when
we
do
the
dot
build
on
the,
and
so
we
can
actually
encapsulate
this
on
the
the
menu,
the
top
nav
menu
builder,
and
that's
that
builder's
build
method.
That's
when
we
can
do
that.
Header
cleanup
step.
That's
one
approach!
I
I
have
you
know
reservations
because
it's
it's
a
weird.
You
know
after
processing
thing
to
do,
but
it
does
make
interfacing
with
it
simpler.
B
B
C
You
would
probably
keep
track
of
the
last
header
at
the
bottom
there,
like
an
ad
menu
header,
you
would
probably
deal
with
it
right.
Yeah.
B
So
do
you
know,
what's
you
know,
what's
so
cool
we
can
we
actually
can
get
rid
of?
Oh,
this
would
be
so
sweet
we
we
can.
We
can
get
rid
of
that
public
method
for
add
primary
menu
header.
Let's
just
accept
an
argument
of
what
is
the
header
title
from
where
we're
adding
a
menu
item
right
and
let's
just
do.
B
Let's
encapsulate
all
of
that,
so
you
could
do
spread
art,
let's
go
ahead
and
leave
that
private
method,
but
on
line
12
we
could
do.
A
B
C
A
A
B
Let
me
let
me
let
me
check
on
some
things
downstairs
be
right
back.
C
Okay
line,
thirteen
no.
C
Yeah,
yes
and
then
yes,.
C
C
And
then
probably
you
either
can
do
it
in
a
private
method,
or
you
just
do
it
here
that
you
add
last
header
equals
whatever
right.
B
C
I
have
probably
nothing.
It
should
probably
error.
A
A
Yeah,
that's
right:
okay,
sorry
top
nav
menu
builder.
A
C
C
So
it's
it's
complaining
that
that
header
doesn't
exist
on
some
other
items
right
and
rather
than
adding
header
to
everything
I
just
said
hey.
If
we
can
probably
use
it.
A
A
I
haven't
had
enough
coffee,
yet
all
right
there
we
go
now,
let's
check
the
console
log
and
I'm
sure
this
all
looks
how
we
expect
it
to
I
mean
we
got
milestones
cnn
a
header
item
here.
A
Maybe
we
aren't
destination
push
item,
that's
all
happening
as
it
should
add.
Menu.
Header
must
just
not
be
getting
called
primary
menu
item,
so
we
did
that
in
here.
We
just
kind
of
threw
header
dashboard
here.
Maybe
this
is
not
the
right
spot.
B
Oh,
are
you
look,
are
we
logged
in?
Oh,
this
is
ee
stuff,
yeah.
A
C
You're,
seeing
the
rest
of
the,
if
you
open
your
navigation,
you
see
everything
you
were
definitely
seeing
environments
before
and
now
it's.
C
A
C
A
C
A
Milestone
so
let's
put
something
over
milestones.
Let's
just
I
don't
know
if
dashboard
is
correct,
but
I'm
just
going
to
do
this
to
see
if
it
works
right.
B
C
A
C
Title
colon
header
yeah,
the
in
the
in
the
item
in
the
not
item
but
in
the
heading
it's
named
title
and
not
header.
So
here
we're
doing
the
mapping
right
yeah.
A
C
A
C
A
B
A
B
A
B
It
cool
well.
I
then
think
it'll
be
interesting
how
like
styling
it
not
like
the
other
li
items.
Next
to
it,
you
know,
anytime,
we
have
a
flat
ul
that
has
different
types
in.
It
sometimes
causes.
C
A
Yes,
I'm
sure
it's.
C
Please,
let's
fix
this,
get
it
merged
and
then
talk
to
your
ex
about
accessibility.
We
want
to
ship
with
this
milestone
and
not
in
five
milestones.
Right,
yeah.
C
B
B
Cool
okay,
that's
that's
great
yeah
and
maybe
be
fun.
We
got
a
little
bit
more
time
left.
Maybe
we
should
add
the
conditional
into
the
view
code.
The
view.
A
While
I
have
you
on
here,
I
wanted
to
ask
something
else.
I
know
we
have.
We
had
a
like
ad
menu
item
with
shortcuts,
like
the
thing
in
here
as
well.
I
don't
remember
where
it
is.
Yeah,
add
primary
menu
item
with
shortcut
and
it
looks
like
it
just
adds
shortcuts
to
its
own
separate
bucket,
and
then
it
renders
these
in
like
a
hidden,
yes
ul
somewhere.
Just
for
our
shortcuts
to
to
to
use.
Is
that
or
is
there
a
reason
it
was
necessary
to
implement
it?
That
way,
it
just
sounds.
B
I
mean
that's
just
keeping
in
line
with
how
the
shortcuts
this
is
without.
We
don't
want
to
touch
the
shortcuts
code,
but
we're
changing
how
we
rendered
these
and
shortcuts
were
coupled
to
it's
looking
like
that,
and
so
this
was
okay.
I
don't
want
to
change
how
shortcuts
are
done,
which
we're
done
in
a
really
interesting
way.
So,
let's
just
move
short
yeah.
A
B
B
A
B
C
Yeah,
I
I
just
realized
one
downside
of
our
approach,
but
it's
not
fixed
any.
It's
not
possible
anyhow
right
now,
anyway.
Imagine
in
ee,
if
you
want
to
add
an
item
to
the
second
group,
for
example
right,
that's
at
the
moment.
That's
that's
something!
That's
like
it's
not
yeah!.
A
C
C
C
A
A
B
C
Like
that's
future
mic
future
poor
and
future
problem.
B
So
you
know
what,
though,
I
kind
of
like
I
kind
of
like
encapsulating
this
in
the
builder
like
what,
if,
rather
than
just
keeping
track
of
the
last
header.
A
B
B
A
B
We
could,
even
just
at
the
very
least,
this
is
the
least
performant
way,
but
we
could
simply
search
for
the
header
and
maybe
looking
optimizing
by
seeing
a
set
of
exactly
and
then
just
splice
it
at
the
end,
like
I,
I
like
thinking
of
that
as
an
implementation,
you
know
rather
than
let's
change
the
whole
mind.
Api
yeah,
because,
like
yeah,
google
is
keeping
this
front
end.
Stupid,
simple
and
yeah.
B
A
A
No
we're
just
okay.
A
A
Environments,
operations
and
security,
so
those
are
all
there
geo,
doesn't
need
a
header,
it's
in
the
secondary,
pending
deletion.
That's.
A
A
A
No
add
primary
menu
item
with
shortcut.
Is
that
still
going
to
pass
through
this
header?
Okay,
yeah.
C
They
should
I
mean
it
already
passed
the
tool
with
the
milestone
right.
That's
so
that's
true.
That's.
A
Right
we
just
tested
it
groups
and
projects
are
going
to
be
different
activities.
That
was
yes,
yes,
all
right.
What
else
is
down
here?
This
is.
A
Mean
cool
and
then
we
got
the
groups
and
projects
all
right,
nothing
to
touch
there,
so
just
projects
and
groups
go
to
switch
to.
C
B
Explorer
so
probably
I
mean
I
would
probably
push
back
on
that
because
I
think
we
have
elsewhere,
maybe
a
pattern
of
not
showing
headers.
If
there's
not
separate.
A
Be
you
know,
mindlessly
copying
what
was
in
sigma
and
I'll
blame
it
on
them
afterwards,
but
yeah
and
I'll
bring
that
up
and
review.
It's
easy
enough
to
take
out.
A
C
B
A
A
B
C
So
it
should
be,
but
the
problem
is
then
you
need
to
now.
You
need
to
do
the
for
loop
with
outside,
with
a
template,
thingy
right
then.
A
A
A
A
A
Yeah,
I
don't
think
it'll
matter
so
if
vf
type
equals
menu
item
dot.
B
C
C
Oh,
please
don't
paul
we're
already
five
components
deep,
like
we
don't
need
to
overcomplicate
things.
Let's.
B
A
Stop
it
yeah
padding.
A
C
I
think
after
this
we
can
also
padding
ourselves
on
the
back
right.
B
C
B
A
Yeah,
that's
pretty
straightforward.
Actually
this
doesn't
look
terrible
but
but
yeah
just
that's
not
included
in
the
mock-up.
Let's
not
touch
it.
C
It's
not
included
in
the
mock-up
because
they
probably
are
not
aware
that
the
responsive
view
exists.
I
think
this
could
also
be
a
quick
ping
right.
I
mean
this
would
also
could
also
be
a
ping
on
dmr,
but
I
think
hey,
hey,
nick,
look,
we
have
the
responses,
you
should
be
at
the
groups,
yes
or
no.
It's
not
like
that.
You
don't
have
enough
horizontal
space
right
vertically,
like
I
don't
know
enough
space
to
show
the
group
stare
as
well
right.
C
A
Is
good,
I
think
I
can
probably
take
it
here
and
clean
it
up
and
put
together
a
murder
request,
but
yeah.
I
appreciate
well,
it's
been
over
an
hour
already.
C
B
Yeah,
thanks
for
thanks
for
working
on,
it
feel
free
to
change
it
up.
However,
you
want
yeah.
It
clearly
could
use
some
some
levels
of
of
loving,
but
I'm
glad.
B
C
A
C
I
I
I
think,
I
think
probably
the
condition
right
now
would
be
like
super
easy,
because
you
would
just
need
to
do
the
gl
on
whatever
feature
flag
pushing
and
then
you
could
just
have
a
look
at
your
that
you
could
just
have
a
look
in
the
component
where
we
had
added
the
in
the
loop
editor
vf
could
just
render
it
conditionally
there
as
well
so
yeah.
That's
probably.
B
Would
be
a
computed
of
filtering
out
the
headers
yeah
anyways
cool
thanks,
everybody
good
start
all
right,
adios.