회전하는 Composer 플레이스홀더

:discourse2: 요약 Rotating Composer Placeholder는 Discourse 컴포저에 동적으로 회전하는 플레이스홀더 텍스트를 추가하여, 컴포저가 열릴 때마다 다른 프롬프트를 표시합니다.
:hammer_and_wrench: 리포지토리 링크 https://github.com/Ethsim12/discourse-rotating-composer-placeholder
:open_book: Discourse 테마를 처음 사용하시나요? Discourse 테마 사용 입문가 가이드

이 테마 컴포넌트 설치

기능

  • 컴포저가 열릴 때마다 컴포저 플레이스홀더 텍스트를 회전시킵니다
  • 다음 항목에 작동합니다:
    • 답변
    • 새 주제 컴포저
  • 테마 컴포넌트 설정을 통해 완전히 설정할 수 있습니다
  • 플러그인 불필요
  • 클라이언트 사이드 전용 (안전하고 가볍습니다)
  • 최신 api-initializers를 사용합니다

설치

  1. Discourse 관리자에서 다음으로 이동하세요:
    관리자 → 외관 → 테마 및 컴포넌트 → 컴포넌트 → 3개 점

  2. 설치를 클릭하세요.

  3. Git 리포지토리에서를 선택하세요.

  4. 이 리포지토리 URL을 붙여넣고 설치를 클릭하세요.

테마 컴포넌트 활성화

테마 컴포넌트를 설치한다고 해서 자동으로 활성화되지 않습니다.
테마에 연결해야 합니다.

  1. 다음으로 이동하세요:
    관리자 → 외관 → 테마 및 컴포넌트 → 컴포넌트 → Rotating Composer Placeholder

  2. 활성 테마를 클릭하세요
    (예: “기본값”, “데스크톱” 또는 사용자 정의 테마).

  3. 초록색 체크박스를 누르세요.

  4. 브라우저를 새로고침하세요.

활성화되면 해당 테마에 컴포넌트가 즉시 적용됩니다.

컴포넌트 설정

  1. 여전히 테마 컴포넌트 페이지 내에서 작업하세요.

  2. rotating_placeholders 목록을 편집하세요.

예시 값:

  • 무엇을 시도해 보셨나요? 재현 단계를 포함해 주세요.
  • 답변당 하나의 아이디어만. 새로운 문제라면 새 주제를 시작하세요.
  • 다음 내용을 포함해 주세요: 예상 결과, 실제 결과, 오류 내용.
  • 팁: ```삼중 백틱``` 안에 로그를 붙여넣으세요.

참고:

  • 각 목록 항목은 가능한 플레이스홀더가 됩니다.
  • 빈 항목은 무시됩니다.
  • 목록이 비어 있으면 기본 플레이스홀더가 사용됩니다.

알려진 제한 사항

  • UI 전용 개선 사항
  • 게시물 콘텐츠에 영향을 주지 않습니다
  • 플레이스홀더는 컴포저가 열릴 때 회전합니다
  • 향후 컴포저 리팩토링 시 셀렉터의 소규모 업데이트가 필요할 수 있습니다

호환성

  • 최신 Discourse 버전을 위해 설계되었습니다
  • 권장 최소 버전: Discourse 3.2+
  • 지원되는 테마 API만 사용합니다
4개의 좋아요

Can you share examples of use case?

1개의 좋아요

I think the examples do a good job demonstrating the use case. There are lots of things to consider when composing a message. If you put just one, it’ll soon be ignored. If you put all of those, no one would read any of them. Having a different one each time increases the likelihood that someone might read and consider one of them.

You could also put funny Easter eggs.

4개의 좋아요

Oh , right, I didn’t even see the examples.

Game of Thrones: The Walk of Shame

3개의 좋아요

Thanks! One nice bonus I found is that the component works cleanly with the rich text composer as well - the placeholder still rotates correctly there.

Since it hooks into the composer lifecycle rather than editor-specific internals, it doesn’t rely on Markdown-only selectors, which helps keep it compatible across composer modes.

If Discourse refactors the editor again in future, this should hopefully keep the surface area for breakage fairly small.

1개의 좋아요

nicely done @Ethsim2 :clap:

Perhaps category specific placeholders could be a useful addition? (although I sort of recall there may be a component somewhere that already does that feature)

I actually want to use this to make them ALL funny on one of my forums…

“WHAT IS WRONG WITH YOU? CAN’T YOU READ???”
“What’s the difference between someone who doesn’t search before posting and a lazy arse?”
"If you are reporting a bug, please first make sure it is not an arachnid. "
“What is the airspeed velocity of an unladen swallow?”

5개의 좋아요

You’re welcome! :slightly_smiling_face:

Category-specific placeholders is a really nice idea - I can see it being especially useful for “Support / Bug” vs “General chat” categories, where the prompts you want users to see are completely different.

Implementation-wise, the composer context usually provides enough signal to do this cleanly:

• New topic: key off the selected categoryId in the composer model

• Reply: derive the category from the topic context

So a possible v1 could look like:

• a theme setting mapping category_id → placeholder list

• fallback to the global rotating_placeholders if no category match is found

If you remember the existing component you’re thinking of, I’d love a link - otherwise I’m happy to add this here as a feature request and gauge interest (and avoid duplicating work if it already exists).

Also - your “ALL funny” list is exactly the kind of chaotic good I had in mind :joy:

(I’d probably still mix in a few serious ones, so the occasional useful reminder sneaks through!)

There is Topic Template Placeholder Text theme component where you can use the category template as the placeholder

2개의 좋아요

Thanks! That’s a really helpful link.

That component (“Topic Template Placeholder Text”) is slightly different to what this one is doing: it uses the category topic template as the placeholder (so the placeholder is category-specific, but it’s essentially the template content).

This theme component rotates through a list of short prompts each time the composer opens (and it applies to replies as well as new topics). So “category-specific placeholders” could still be a useful addition here if we want rotating per-category lists with a fallback to the global list - especially for “Support/Bug” vs “General chat”.

But if someone’s goal is specifically “show my category template as placeholder”, that other TC already solves it nicely.