Page MenuHomePhabricator

"In more languages" toggle state persistence
Open, NormalPublic8 Story Points

Description

Motivation
Depending on what you want to achieve when looking at an item page, it might make more sense to have the termbox expanded:


or collapsed:

This ticket is about saving the termbox expension state as users wanted it, in the assumption they will need the same behavior the next time they are visiting an item page.

Acceptance criteria:

  • The toggle behavior state of the "In more languages" link is persistent throughout the browser session.

Notes:

  • Estimation for the creation of the cookie on the client side and passing the link state information to the server side renderer
  • the follow-up for logged in users is T211771

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 14 2018, 3:54 PM
WMDE-leszek updated the task description. (Show Details)Nov 14 2018, 4:00 PM
WMDE-leszek set the point value for this task to 8.Nov 14 2018, 4:05 PM

@WMDE-leszek: Which software project is this about?

Pablo-WMDE updated the task description. (Show Details)Nov 15 2018, 10:39 AM
Pablo-WMDE updated the task description. (Show Details)
Pablo-WMDE added a comment.EditedNov 15 2018, 11:19 AM

Little research regarding "in more languages" content

with JS

Not logged in

Q2 -> en, de, fr, bay
Q2?uselang=es -> es, en

Logged in

Q2 -> de, en, es (user preferences)
Q2?uselang=es -> es, de, en

without JS

Not logged in

Q2 -> en (probably preferred browser lang)
Q2?uselang=es -> es, en

Logged in

Q2 -> de, en, es (user preferences)
Q2?uselang=es -> es, de, en

Persistence

How is the link click persisted

with JS

Logged in

api.saveOption( // i.e. "action: options"
	'wikibase-entitytermsview-showEntitytermslistview',
	visible ? '1' : '0'
)
mw.user.options.set(
	'wikibase-entitytermsview-showEntitytermslistview',
	visible ? '1' : '0'
);

Not logged in (mw.user.isAnon())

Cookie wikidatawikiwikibase-entitytermsview-showEntitytermslistview
value: true|false
expires: 1y

without JS

The link is not shown, no CTA, nothing to persist


@Lea_WMDE

  • persistence happens as we imagined when estimating if the user is not logged in. The cookie has a lifetime of 1y
  • the toggle state is persisted in the user settings if the user is logged in. Interestingly is not persisted in the cookie in this case. Implementing this did not go into the estimation above.
  • found T209576 along the way (non blocking)

As I am not sure if we want to reach complete feature parity in this case or go another way I did not create a new story / change the current story just yet.

Lea_WMDE triaged this task as Normal priority.Nov 22 2018, 2:20 PM
Lea_WMDE updated the task description. (Show Details)

Thanks @Pablo-WMDE ! I will discuss this with Hanna on Monday and get back to you.

Lea_WMDE renamed this task from "In more languages" link state to "In more languages" link state for logged out users.Dec 12 2018, 2:56 PM
Lea_WMDE updated the task description. (Show Details)
WMDE-leszek renamed this task from "In more languages" link state for logged out users to "In more languages" link state.Dec 12 2018, 3:53 PM
WMDE-leszek updated the task description. (Show Details)
Lea_WMDE renamed this task from "In more languages" link state to "In more languages" toggle state.Dec 17 2018, 11:19 AM
Pablo-WMDE updated the task description. (Show Details)Feb 5 2019, 1:48 PM
Pablo-WMDE renamed this task from "In more languages" toggle state to "In more languages" toggle state persistence.May 16 2019, 1:45 PM