본문으로 건너뛰기
Skillpedia
일반 코딩48k · #5642

robius-event-action

하는 일

이 도구는 컴퓨터 프로그램의 여러 부분이 서로 소통하는 방식을 정리하도록 돕습니다. 버튼 클릭 같은 액션과 메시지 수신 같은 이벤트가 체계적인 방식으로 처리되도록 패턴을 정의합니다.

사용하는 경우

  • ✓프로그램에 새로운 사용자 정의 액션을 만들 때.
  • ✓프로그램의 여러 부분이 이벤트에 반응해야 할 때.
  • ✓화면 요소(위젯) 사이의 소통을 관리할 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/robius-event-action/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/robius-event-action/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“버튼을 클릭하면 특정 메시지가 전송되도록 프로그램을 어떻게 설정할 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 도구는 이벤트에 의해 실행될 수 있는 ‘액션’을 정의하는 방식으로 작동합니다. 이 액션들은 프로그램의 중앙 위치에서 처리되어, 모든 것이 일관되게 다뤄지도록 합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Supporting material availability

This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:

  • <support-root>/references/action-patterns.md
  • <support-root>/references/event-handling.md
  • <support-root>/references/moly-action-patterns.md

Ask for the original supporting material or an existing installation before using a step that depends on these paths; this catalog does not identify a verified download source for them. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.

Robius Event and Action Patterns Skill

Best practices for event handling and action patterns in Makepad applications based on Robrix and Moly codebases.

Source codebases:

  • Robrix: Matrix chat client - MessageAction, RoomsListAction, AppStateAction
  • Moly: AI chat application - StoreAction, ChatAction, NavigationAction, Timer patterns

When to Use

Use this skill when:

  • Implementing custom actions in Makepad
  • Handling events in widgets
  • Centralizing action handling in App
  • Widget-to-widget communication
  • Keywords: makepad action, makepad event, widget action, handle_actions, cx.widget_action

Custom Action Pattern

Defining Domain-Specific Actions

use makepad_widgets::*;

/// Actions emitted by the Message widget
#[derive(Clone, DefaultNone, Debug)]
pub enum MessageAction {
    /// User wants to react to a message
    React { details: MessageDetails, reaction: String },
    /// User wants to reply to a message
    Reply(MessageDetails),
    /// User wants to edit a message
    Edit(MessageDetails),
    /// User wants to delete a message
    Delete(MessageDetails),
    /// User requested to open context menu
    OpenContextMenu { details: MessageDetails, abs_pos: DVec2 },
    /// Required default variant
    None,
}

/// Data associated with a message action
#[derive(Clone, Debug)]
pub struct MessageDetails {
    pub room_id: OwnedRoomId,
    pub event_id: OwnedEventId,
    pub content: String,
    pub sender_id: OwnedUserId,
}

Emitting Actions from Widgets

impl Widget for Message {
    fn handle_event(&mut self, cx: &mut Cx, event: &Event, scope: &mut Scope) {
        self.view.handle_event(cx, event, scope);

        let area = self.view.area();
        match event.hits(cx, area) {
            Hit::FingerDown(_fe) => {
                cx.set_key_focus(area);
            }
            Hit::FingerUp(fe) => {
                if fe.is_over && fe.is_primary_hit() && fe.was_tap() {
                    // Emit widget action
                    cx.widget_action(
                        self.widget_uid(),
                        &scope.path,
                        MessageAction::Reply(self.get_details()),
                    );
                }
            }
            Hit::FingerLongPress(lpe) => {
                cx.widget_action(
                    self.widget_uid(),
                    &scope.path,
                    MessageAction::OpenContextMenu {
                        details: self.get_details(),
                        abs_pos: lpe.abs,
                    },
                );
            }
            _ => {}
        }
    }
}

Centralized Action Handling in App

Using MatchEvent Trait

impl MatchEvent for App {
    fn handle_startup(&mut self, cx: &mut Cx) {
        // Called once on app startup
        self.initialize(cx);
    }

    fn handle_actions(&mut self, cx: &mut Cx, actions: &Actions) {
        for action in actions {
            // Pattern 1: Direct downcast for non-widget actions
            if let Some(action) = action.downcast_ref::<LoginAction>() {
                match action {
                    LoginAction::LoginSuccess => {
                        self.app_state.logged_in = true;
                        self.update_ui_visibility(cx);
                    }
                    LoginAction::LoginFailure(error) => {
                        self.show_error(cx, error);
                    }
                }

…
자주 묻는 질문

‘액션’과 ‘이벤트’는 무엇인가요?

액션은 프로그램이 명령에 따라 하는 일입니다(예: ‘파일 저장’). 이벤트는 프로그램이 감지할 수 있는 일이 일어난 것입니다(예: ‘마우스 클릭’).

Makepad란 무엇인가요?

Makepad는 앱의 사용자 인터페이스를 만드는 데 쓰이는 도구입니다.

액션과 이벤트에 패턴이 왜 중요한가요?

패턴은 코드를 체계적으로 유지하고 이해하기 쉽게 하며, 특히 크고 복잡한 프로그램에서 오류를 줄이는 데 도움이 됩니다.

상세 정보

작성자의 원본 설명

CRITICAL: Use for Robius event and action patterns. Triggers on: custom action, MatchEvent, post_action, cx.widget_action, handle_actions, DefaultNone, widget action, event handling, 事件处理, 自定义动作

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#5642
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬