<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2026, Jiri Eischmann <jiri@eischmann.cz> and the meshy contributors -->
<!-- SPDX-License-Identifier: GPL-3.0-or-later -->
<interface>
  <requires lib="gtk" version="4.0"/>
  <requires lib="libadwaita" version="1.0"/>

  <menu id="add_channel_menu">
    <item>
      <attribute name="label" translatable="yes">Create a Private Channel</attribute>
      <attribute name="action">channel.create-private</attribute>
    </item>
    <item>
      <attribute name="label" translatable="yes">Join a Private Channel</attribute>
      <attribute name="action">channel.join-private</attribute>
    </item>
    <item>
      <attribute name="label" translatable="yes">Join the Public Channel</attribute>
      <attribute name="action">channel.join-public</attribute>
    </item>
    <item>
      <attribute name="label" translatable="yes">Join a Hashtag Channel</attribute>
      <attribute name="action">channel.join-hashtag</attribute>
    </item>
  </menu>

  <template class="MeshyChannelsView" parent="GtkBox">
    <property name="orientation">vertical</property>

    <!-- Search entry (toggled by search button) -->
    <child>
      <object class="GtkSearchEntry" id="search_entry">
        <property name="placeholder-text" translatable="yes">Search...</property>
        <property name="margin-start">8</property>
        <property name="margin-end">8</property>
        <property name="margin-bottom">6</property>
        <property name="visible">false</property>
      </object>
    </child>

    <child>
      <object class="GtkScrolledWindow">
        <property name="vexpand">true</property>
        <property name="child">
          <object class="GtkListBox" id="channel_list">
            <property name="selection-mode">single</property>
            <style>
              <class name="navigation-sidebar"/>
            </style>
          </object>
        </property>
      </object>
    </child>

    <!-- Status -->
    <child>
      <object class="GtkLabel" id="status_label">
        <property name="label" translatable="yes">No channels</property>
        <property name="margin-top">4</property>
        <property name="margin-bottom">2</property>
        <style>
          <class name="dim-label"/>
          <class name="caption"/>
        </style>
      </object>
    </child>

    <child>
      <object class="GtkMenuButton" id="add_btn">
        <property name="label" translatable="yes">Add Channel</property>
        <property name="menu-model">add_channel_menu</property>
        <property name="margin-start">8</property>
        <property name="margin-end">8</property>
        <property name="margin-top">4</property>
        <property name="margin-bottom">8</property>
      </object>
    </child>

  </template>
</interface>
