기본적으로 이 컴포넌트는 모든 사용자에게 개인 받은 편지함 링크를 추가합니다. show_personal_inbox 설정을 통해 관리자는 이를 완전히 숨기거나, Personal message enabled groups 사이트 설정에 따라 PM 생성이 허용된 사용자만 표시하도록 설정할 수 있습니다. 이는 개인 받은 편지함 링크가 알림 메뉴, 사용자 프로필, 사이드바의 커뮤니티 섹션에 표시되는 방식과 일치합니다.
개인 받은 편지함 링크가 중복 표시되지 않도록 하려면, 사이드바의 첫 번째 섹션에 있는 메시지 링크를 제거하는 것이 좋습니다. 더 보기 메뉴를 열고 이 섹션 사용자 지정을 선택한 후, 해당 섹션에서 메시지 링크를 제거하면 됩니다.
그룹 받은 편지함
최소 하나의 메시지가 있고 사용자가 회원인 모든 그룹 받은 편지함은 자동으로 해당 사용자의 사이드바에 표시됩니다. 관리자는 hide_group_inboxes 설정을 사용하여 특정 그룹 받은 편지함을 숨길 수 있으며, 이는 더 이상 능동적으로 사용되지 않는 그룹 받은 편지함인 경우 유용할 수 있습니다.
별도의 설정인 use_group_page_inbox을 사용하면 그룹 받은 편지함 링크가 사용자의 메시지 인터페이스(/my/messages/group/{group_name})에서 열리도록 할지, 아니면 그룹 페이지(/g/{group_name}/messages/inbox)에서 열리도록 할지 선택할 수 있습니다.
읽지 않은 표시기
각 받은 편지함 링크는 사용자의 “새 항목 수 표시” 선호도에 따라 현재 메시지 상태를 표시합니다. 점(dot) 또는 숫자 카운트 중 하나입니다. 100을 초과하는 값은 99+로 표시됩니다.
고급 그룹 받은 편지함 구성
그룹 받은 편지함의 순서를 사용자 지정하거나 사이드바에 표시되는 이름을 변경하려면 advanced_group_inbox_configuration 설정을 사용할 수 있습니다.
이 설정에서 다음을 수행할 수 있습니다:
드롭다운에서 그룹 선택
사이드바에 표시될 사용자 지정 이름 선택적으로 정의
하단의 버튼을 사용하여 구성된 그룹 순서 변경
사용자 지정 이름은 설정 자체 내부에서도 유용합니다.
이름이 제공되지 않으면 항목은 group 1, group 2 등으로 라벨이 붙습니다(위치에 기반). 임시 이름을 추가하면 순서 변경이 더 쉬워질 수 있으며, 원하면 저장 전에 다시 제거할 수 있습니다.
메시지가 있는 그룹 중 고급 구성에 추가되지 않은 그룹은 여전히 사이드바에 표시되며, 구성된 그룹 뒤에 그룹 ID 순서대로 나열됩니다.
hide_group_inboxes 설정에 나열된 그룹은 고급 구성에도 존재하거나 메시지가 있든 상관없이 항상 숨겨집니다. 그룹이 두 설정 모두에 추가되었을 때 이를 강조하기 위한 관리자 전용 경고가 있습니다.
아래 스크린샷에서 예시 구성과 그것이 순서 및 표시 이름에 미치는 영향을 확인할 수 있습니다:
Minor suggestion: perhaps javascripts/discourse/api-initializers/group-inboxes-in-sidebar.gjs should be a JS file instead of GJS?
Great component!
I spent the last 10 minutes looking through the code and examining core classes and I must say how remarkable Discourse was (and is) made such that everything fits in so well.
Yes, the API offers almost everything you need to make the section look and work like all the others. The chat uses it too, which probably influenced the development; the features were developed at the same time.
Unfortunately, get badgeText(), which displays the number of unread topics in the core sections, is not supported, so I had to get a little creative with the numbers.
Why do you prefer the link to be hidden with CSS instead of using the existing option for admins to customize the sidebar? Hiding with CSS seems more likely to break than using built in Discourse options.
Yes you did. But as admins we are often used to going through the admin panel. . Do when skimming instructions we might gloss over some details.
Even with core updates I am sure many of us don’t always read over all the fine details until something we use has been moved to another area
Long long ago with Android for example iirc Gingerbread use to have Nav & Maps. I spent about 10m looking for Nav after they merged it with Maps in an update.
This is a brilliant Theme Component which suits sites that lean heavily on Messages! Thanks @moin for your excellent work!
In order to make it even better for those who use Groups quite a bit (Messages are a big component of this), would you mind considering these suggestions?
Selectable position on the sidebar
In order to emphasise Messages more in the UI, I’d like them at the top of the Sidebar (i.e. just under the links). Basically, I want people to be able to easily see their recent Messages (per group) at a glance without relying on notifications.
I’ve used this CSS to achieve that, but suspect I’m not the only one who this would be helpful for:
/* Ensure the Messages section appears first in the flexbox container */
.sidebar-section-wrapper {
order: 1;
}
.sidebar-section-wrapper[data-section-name="inbox-section"] {
order: 0;
}
Have group inboxes open in the group context
I want my users to be able to easily find interact with their Group(s). It makes sense to me to have them work with Messages in the Inbox which is accessed from the Group page (i.e. /g/the-group/messages/inbox) instead of their Personal Inbox page (i.e. /my/messages/group/the-group)
This gives them a nice clean group-centred page, with easy access to the other group members and settings:
I have thought about this, about which route is a better default and a setting, but I removed it for some reason I don’t remember right now. I will take a look tomorrow later. I think it was about the unread message indicator. Would you still prefer this route if the consequence was that there would be no indicator for unread messages?
I think the current position is the same as the messages section that was in core.
There is already a great component about changing the order of sections in the sidebar: Navigation (sidebar) menu display control
To avoid conflicts because both components try to override the order it might make sense that admins who want a different order use the existing component (The author confirmed it works using “inbox-section” as the section name).
I’ll have to see whether I can offer an additional setting for this. In any case, I want to avoid the components interfering with each other.
I’ve been mucking about with this in my fork, and have found the same thing. It works, but loses both the unread message indicator and the link highlighting on the sidebar. Both those things are indeed high value!
Why did you use href instead of route? I think href didn’t work with unread indicators at all. I was more concerned that the numbers on the group.messages.inbox route were not available in the way you can use them at userPrivateMessages.
Because I’m a rubbish dev, and tried a bunch of things until something stuck! Probably also due to my unhealthy reliance on not-so-smart gen AI .
I’ve tried to utilise routes, but couldn’t actually get it to override the existing routes. So I gave up.
I did wonder if it was possible to get those numbers / behaviour, while simply hijacking the link to go to a different location. But this is a bit complex for simple old me.
Feel free to ‘improve’ it!
(BTW the wonderful @moin has done exactly that, adding the functionality - making it work properly!)
이 기능은 그룹의 짧은 이름 대신 전체 이름을 표시해 달라는 요청과도 결합했습니다. 이 컨텍스트에서 전체 이름을 쉽게 가져올 수 없기 때문에, 대신 관리자가 custom display name(사용자 정의 표시 이름)을 정의할 수 있도록 했습니다. 이전에 설정에서 그룹 이름만 표시하는 데 사용되던 필드가 이제 사이드바에 표시되는 이름도 제어합니다.
두 기능 모두 새로운 advanced_group_inbox_configuration 설정을 통해 처리됩니다.
이 설정에서 다음을 수행할 수 있습니다:
드롭다운에서 그룹 선택
사이드바에 표시될 사용자 정의 이름 선택적으로 정의
하단의 버튼을 사용하여 설정된 그룹 순서 변경
사용자 정의 이름은 설정 내부에서도 유용합니다.
이름이 제공되지 않으면 항목은 group 1, group 2 등으로 표시됩니다(위치 기반). 임시 이름을 추가하면 순서 변경이 쉬워지며, 원한다면 저장 전에 다시 제거할 수 있습니다.
고급 설정에 추가되지 않은 메시지 있는 그룹도 여전히 사이드바에 표시됩니다. 설정된 그룹 뒤에 나열되며 그룹 ID 순서로 정렬됩니다. hide_group_inboxes 설정에 나열된 그룹은 고급 설정에 포함되었거나 메시지가 있든 관계없이 항상 숨겨집니다.
여기서 'doggo-daily’와 ‘cat_pics’ 인박스가 위치를 바꿨고, 하이픈이나 언더스코어 없이 표시되는 것을 볼 수 있습니다. ‘Team’ 인박스는 고급 설정에서 구성된 것들 아래에 나타납니다.
또한 관리자 전용 경고도 볼 수 있는데, 이는 ‘admin’ 그룹이 고급 설정과 hide_group_inboxes 설정에 동시에 추가되었기 때문에 표시됩니다.
많은 그룹을 다룰 때 특히 유용한 기능이 이 플러그인의 일부가 될 수 있을지 여쭤봅니다. 모든 그룹 메시지의 통합 보기입니다. 개인 메시지(PN) 보기에서는 메시지가 그룹에도 전송됨을 나타내는 작은 배지가 이미 표시되는데, 메시지가 속한 그룹을 배지로 표시하는 방식으로 모든 메시지를 보여주는 건 어떨까요:
이 기능이 이 테마 컴포넌트에 잘 어울리지 않을 것 같습니다. 이 컴포넌트의 목표는 매우 구체적입니다. 바로 사이드바에 메시지 섹션을 추가하는 것입니다. 완전히 다른 기능을 하나의 컴포넌트에서 지원하는 것은 이해와 유지보수를 어렵게 만들므로 이를 권장하지 않습니다. 이러한 종류의 기능은 별도의 커스터마이징으로 처리하는 것이 더 적절합니다.
더 중요한 점은, 이것이 실제로는 테마 컴포넌트가 잘 처리할 수 있는 성격의 문제가 아니라는 것입니다. 테마 컴포넌트는 프론트엔드에 이미 존재하는 데이터나 기존 백엔드 엔드포인트에서 합리적으로 가져올 수 있는 데이터만 처리할 수 있습니다. 이 컴포넌트가 사이드바에 그룹 인박스를 표시할 수 있는 이유도 바로 이것입니다. Discourse의 많은 부분이 사용자가 속한 그룹을 알아야 하므로, 해당 정보는 이미 손쉽게 이용 가능합니다.
그러나 말씀하신 기능은 모든 그룹 인박스에 걸친 메시지 데이터에 접근해야 합니다. 현재 Discourse는 이러한 데이터를 한 곳에서 통합하여 제공하지 않습니다. 이론적으로 테마 컴포넌트가 각 그룹 인박스를 하나씩 순차적으로 가져올 수는 있지만, 이는 곧 비효율적이 됩니다. 각 요청은 첫 30개의 메시지만 반환하므로, 인박스당 여러 페이지를 로드해야 합니다. 그리고 메시지를 활동 순으로 정렬하려면 사실상 모든 인박스의 모든 메시지를 동시에 가져와야 합니다.
이러한 제한 사항들로 인해, 테마 컴포넌트는 이 용도에 적합하지 않습니다. 이러한 데이터를 반환하는 적절한 백엔드 엔드포인트를 추가하는 플러그인을 사용하는 것이 훨씬 더 합리적이고 확장 가능한 접근 방식입니다.