Fix chat bubble visibility, friends refresh, and DM close

- Chat bubble now hidden on all scenes; MainScreen shows/hides it via
  Chat.set_bubble_visible() in _ready/_exit_tree
- send_friend_request now uses Network.request so _fetch_social() fires
  on success, making the friends list update immediately after adding
- Added DM close button (✕) to each conversation row in the DMs tab;
  _close_dm removes the channel from local state via Chat.close_dm()

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-03-06 22:14:43 -05:00
co-authored by Claude Happy
parent a482cc5319
commit dceabf4f06
8 changed files with 55 additions and 4 deletions
@@ -0,0 +1 @@
uid://b3kkhkytruoo4
@@ -0,0 +1 @@
uid://btgg7fge6j3j6
@@ -796,6 +796,9 @@ func _refresh_dm_list() -> void:
var cid : String = chan.get("id", "")
var name : String = chan.get("name", "DM")
var row := HBoxContainer.new()
row.add_theme_constant_override("separation", 0)
var btn := Button.new()
btn.text = name
btn.flat = true
@@ -803,12 +806,24 @@ func _refresh_dm_list() -> void:
btn.custom_minimum_size = Vector2(0, 36)
btn.add_theme_font_size_override("font_size", 11)
btn.clip_text = true
btn.size_flags_horizontal = Control.SIZE_EXPAND_FILL
if cid == _active_dm:
_apply_tab_btn_style(btn, true)
btn.pressed.connect(func() -> void: _select_dm(cid))
_dm_conv_list.add_child(btn)
row.add_child(btn)
var close_btn := Button.new()
close_btn.text = "✕"
close_btn.flat = true
close_btn.custom_minimum_size = Vector2(24, 36)
close_btn.add_theme_font_size_override("font_size", 10)
close_btn.add_theme_color_override("font_color", MUTED_COLOR)
close_btn.pressed.connect(func() -> void: _close_dm(cid))
row.add_child(close_btn)
_dm_conv_list.add_child(row)
func _select_dm(channel_id: String) -> void:
@@ -823,6 +838,17 @@ func _select_dm(channel_id: String) -> void:
_refresh_dm_list()
func _close_dm(channel_id: String) -> void:
if _active_dm == channel_id:
_active_dm = ""
_active_channel = ""
_input_bar.visible = false
if is_instance_valid(_dm_msg_list):
for c in _dm_msg_list.get_children():
c.queue_free()
Chat.close_dm(channel_id)
func _refresh_dm_messages() -> void:
if not is_instance_valid(_dm_msg_list):
return
@@ -0,0 +1 @@
uid://blb4o22kdgh5r
@@ -19,6 +19,7 @@ extends Control
func _ready() -> void:
welcome_label.text = "Welcome, %s!" % Auth.display_name
Chat.set_bubble_visible(true)
Network.connected.connect(_update_status)
Network.disconnected.connect(_update_status)
@@ -46,6 +47,7 @@ func _ready() -> void:
func _exit_tree() -> void:
Chat.set_bubble_visible(false)
if Network.connected.is_connected(_update_status):
Network.connected.disconnect(_update_status)
if Network.disconnected.is_connected(_update_status):
@@ -0,0 +1 @@
uid://bmlcf0banjdxd