Show both OP and last reply on mobile

AI-generated summary

Lhc_fl introduced a theme component that displays both the Original Poster (OP) and the last reply avatar on mobile topic lists, inspired by awesomerobot’s previous work. The component places the OP on the left and the last replier on the right, replacing the latter with a clock icon if no replies exist. Canapin noted similarities to another mobile list component, while Wil34 requested desktop support, which Lhc_fl declined, arguing desktop views already provide sufficient detail.

Davis_Ghost reported styling issues where category and tag labels were wrapping unexpectedly. Lhc_fl explained this was intentional design to prioritize category placement, though David_Ghost preferred the previous layout. Aaron_Walsh and copymonopoly asked about updates regarding Discord core changes. Lhc_fl confirmed compatibility after merging a core PR that added a necessary PluginOutlet.

Later, jrgong reported the component broke after a specific commit. Lhc_fl confirmed the issue stemmed from recent core changes. Roi raised a deprecation warning regarding access to site.mobileView during initialization, a concern echoed by eisammy. Roi emphasized the urgency as the notice appeared on every page for admins. Lhc_fl promptly fixed the deprecation issue, resolving the notifications for Roi.

:information_source: Summary This component show topic OP and last reply on mobile
:eyeglasses: Preview Theme Creator
:hammer_and_wrench: Repository Lhcfl/discourse-mobile-topic-op-and-last-reply (github.com)
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

This theme component is heavily inspired by @awesomerobot’s Show Original Poster Avatars - theme-component - Discourse Meta. Let us thank him for his great creation!

This theme component has reached a balance on whether to display the topic OP or the last replyer on the mobile. As you can see, the OP of the topic will be displayed on the left, and the last replyer will be displayed on the right. In particular, if there is no reply, the position of the avatar will be replaced by a clock.

17 Likes

It reminds me a bit of MD Topic List Mobile component :slight_smile:

2 Likes

Thanks !

Can you do that for computer too ?

Didn’t the topic list on the desktop provide us with more detailed information?

1 Like

A good theme component but it’s does that with my category + tag:

IS it possible to fix?

Do you mean nothing is displayed?

I tested the component, and it is working fine on my side:

Hi, its me again. IS there a way to fix this?


If i disable the theme component, its shows as expected

Also, in the preview, category + tags have no spacement:

1 Like

Is there anything wrong with this? This looks as expected.

Before the theme component, it’s shows like that:

I modified your image a bit, and you see, the tag label is actually too long to fit, so it is placed on the next line.

I understand, but its expected to be here:

I have temporally fixed it by limiting the tags a bit to show in 1 line only

Oh, it’s a matter of opinion, it’s by design because I think it looks better to put the tag after the category. :thinking:

1 Like

oh ok. so it’s designed that way. It sounds strange to me because there is a lot of empty space.

but ok, i understand now. Thank you

1 Like

Will this theme component be updated?

1 Like

Come back quickly, please

I’ve completed the maintenance work, but there is a problem - I probably need to put a PluginOutlet in the core. Without this outlet, it will be difficult to rewrite this theme component intact.

DEV: Add a PluginOutlet for mobile-view topic activity number by Lhcfl · Pull Request #31567 · discourse/discourse


update: It’s merged :slightly_smiling_face:

Now the component is compatible with the latest discourse

5 Likes

Is it possible that the commit b35e64 broke the TC on 3.4.2? It stopped working since then. When I installed the older 55f5a52 version, it’s working as expected.

Yes, commit b35e64 relies on fairly recent Discourse core changes

2 Likes

I got a deprecation notice for this great theme component in the developer console of the browser:

[THEME 71 ‘Topic OP and last reply for mobile’] Deprecation notice: Accessing site.mobileView or site.desktopView during the site initialization can lead to errors and inconsistencies when the browser window is resized. Please move these checks to a component, transformer, or API callback that executes during page rendering. [deprecated since Discourse 3.5.0.beta9-dev] [deprecation id: discourse.static-viewport-initialization] [info: Designing for Different Devices (Viewport Size, Touch/Hover, etc.)]

2 Likes

Same here but it’s just a notice for while