Skip to content

Commit 55f882a

Browse files
committed
[Bug Fix] Content initial data-state closed (sync with hidden)
cubic flagged HoverCardContent rendering data-state=open while hidden, which left the enter animation classes active before first show and made semantic state inconsistent. Initial state is now 'closed' (matches the hidden class); the controllers flip it to 'open' on show, so the data-[state=open] enter animation actually plays on reveal. Applied to both hover_card and context_menu content; registry.json regenerated.
1 parent 8b5339a commit 55f882a

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

gem/lib/ruby_ui/context_menu/context_menu_content.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def default_attrs
1212
{
1313
role: "menu",
1414
aria_orientation: "vertical",
15-
data_state: "open",
15+
data_state: "closed",
1616
data: {ruby_ui__context_menu_target: "content"},
1717
class:
1818
"hidden absolute z-50 min-w-[8rem] outline-none pointer-events-auto overflow-hidden rounded-md border bg-background p-1 text-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",

gem/lib/ruby_ui/hover_card/hover_card_content.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def default_attrs
1212
{
1313
data: {
1414
ruby_ui__hover_card_target: "content",
15-
state: :open
15+
state: :closed
1616
},
1717
class: "hidden absolute z-50 rounded-md border bg-background p-4 text-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
1818
}

mcp/data/registry.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@
10471047
},
10481048
{
10491049
"path": "context_menu_content.rb",
1050-
"content": "# frozen_string_literal: true\n\nmodule RubyUI\n class ContextMenuContent < Base\n def view_template(&)\n div(**attrs, &)\n end\n\n private\n\n def default_attrs\n {\n role: \"menu\",\n aria_orientation: \"vertical\",\n data_state: \"open\",\n data: {ruby_ui__context_menu_target: \"content\"},\n class:\n \"hidden absolute z-50 min-w-[8rem] outline-none pointer-events-auto overflow-hidden rounded-md border bg-background p-1 text-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n tabindex: \"-1\",\n data_orientation: \"vertical\"\n }\n end\n end\nend\n"
1050+
"content": "# frozen_string_literal: true\n\nmodule RubyUI\n class ContextMenuContent < Base\n def view_template(&)\n div(**attrs, &)\n end\n\n private\n\n def default_attrs\n {\n role: \"menu\",\n aria_orientation: \"vertical\",\n data_state: \"closed\",\n data: {ruby_ui__context_menu_target: \"content\"},\n class:\n \"hidden absolute z-50 min-w-[8rem] outline-none pointer-events-auto overflow-hidden rounded-md border bg-background p-1 text-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n tabindex: \"-1\",\n data_orientation: \"vertical\"\n }\n end\n end\nend\n"
10511051
},
10521052
{
10531053
"path": "context_menu_controller.js",
@@ -1448,7 +1448,7 @@
14481448
},
14491449
{
14501450
"path": "hover_card_content.rb",
1451-
"content": "# frozen_string_literal: true\n\nmodule RubyUI\n class HoverCardContent < Base\n def view_template(&)\n div(**attrs, &)\n end\n\n private\n\n def default_attrs\n {\n data: {\n ruby_ui__hover_card_target: \"content\",\n state: :open\n },\n class: \"hidden absolute z-50 rounded-md border bg-background p-4 text-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\"\n }\n end\n end\nend\n"
1451+
"content": "# frozen_string_literal: true\n\nmodule RubyUI\n class HoverCardContent < Base\n def view_template(&)\n div(**attrs, &)\n end\n\n private\n\n def default_attrs\n {\n data: {\n ruby_ui__hover_card_target: \"content\",\n state: :closed\n },\n class: \"hidden absolute z-50 rounded-md border bg-background p-4 text-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\"\n }\n end\n end\nend\n"
14521452
},
14531453
{
14541454
"path": "hover_card_controller.js",

0 commit comments

Comments
 (0)