Improve the user onebox in Discourse

User onebox is a bit thin on data per:

We should improve it so it has some more data from the user card.

12 лайков

I have been looking at this. Improving user onebox would require creating a custom template for it, correct?

Hmm it is not terrible now, but I guess there are some improvements like possibly emulating a bit of:

Posted, Joined, Read, Location all seem reasonable for the card.

You would need a custom template, yes.

@codinghorror what do you think here?

5 лайков

Oh I see yes sure the user onebox is pretty weak. Totally fine go for it.

1 лайк

Also doesn’t seem to work for all of my users. Example:

https://se23.life/users/Helen_Thomson

https://se23.life/users/BovillDan

… but does work for me

Is this another problem where there’s no description and Onebox fails to render anything?

2 лайка

That would be my guess, yes.

2 лайка

In theory we could have the onebox description here be synthesized from the user activity or something. "member since: 2017-1, 22 posts, last posted yesterday, avid reader"

The biggest omission there is that it’s not prioritizing “long name” which I think is correct for public shares. It should be “Chris Beach” in the public onebox, weird that the username is there.

3 лайка

This is how it looks like with my changes. Thoughts?
I wonder if it’s really ok to include “posted” and “read recently” since it’s going to be out of date pretty soon after it’s baked?

8 лайков

Looks good!

Yeah, great point, we try to avoid highly time-specific data in oneboxes as they are typically baked only at the time of posting. Perhaps some other stats would be less time dependent here? Join date seems safe enough at least.

4 лайка

I have added a PR add a custom user onebox by majakomel · Pull Request #5542 · discourse/discourse · GitHub, slightly different than the screenshot above, without the time specific stats. Other stats that could be relevant (like created posts/topic count) are also changing fast, so I haven’t included them.

15 лайков

This looks excellent to me! Thanks @maja

8 лайков

Только что снова наткнулся на это и провел быстрый тест — похоже, однабокс профиля пользователя всё ещё выглядит вполне достойно. Не уверен, насколько активно это будет использоваться в сообществах, но лично я в наши дни вполне доволен, когда мы просто упоминаем пользователей через @, а затем позволяем людям кликнуть по имени пользователя, чтобы открыть карточку пользователя, которая более информативна и функциональна.

1 лайк

Да, мне кажется, что можно закрыть эту просьбу о новой функции :+1:

2 лайка

Эта тема была автоматически закрыта через 3 дня. Новые ответы больше не принимаются.