• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

super3 / nilo.chat / 14176174335

31 Mar 2025 04:10PM UTC coverage: 97.627% (+0.05%) from 97.578%
14176174335

push

github

super3
Expand Collapse Area

106 of 108 branches covered (98.15%)

Branch coverage included in aggregate %.

182 of 187 relevant lines covered (97.33%)

5.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.2
/src/components/DirectMessageSidebar.vue
1
<template>
2
  <div class="bg-indigo-darker text-purple-lighter flex-none w-64 pb-6 hidden md:block">
3
    <div class="text-white mb-2 mt-3 px-4 flex justify-between">
4
      <div class="flex-auto">
1✔
5
        <h1 class="font-semibold text-xl leading-tight mb-1 truncate">nilo.chat</h1>
6
        <div class="flex items-center mb-6">
7
          <span :class="[isConnected ? 'bg-green-500' : 'border border-white', 'rounded-full block w-2 h-2 mr-2']"></span>
1✔
8
          <span class="text-white/50 text-sm">{{ username }}</span>
1✔
9
        </div>
10
      </div>
11
    </div>
12
    
13
    <!-- Channels section -->
14
    <div class="mb-8">
15
      <div class="px-4 mb-2 text-white flex items-center">
16
        <div @click="toggleChannels" class="cursor-pointer w-4 mr-2 flex justify-center">
17
          <svg v-if="showChannels" class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
18
            <path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/>
19
          </svg>
20
          <svg v-else class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
21
            <path d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"/>
22
          </svg>
23
        </div>
24
        <div @click="toggleChannels" class="opacity-75 flex-1 cursor-pointer">Channels</div>
25
        <div>
18✔
26
          <svg class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
27
            <path d="M11 9h4v2h-4v4H9v-4H5V9h4V5h2v4zm-1 11a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" />
28
          </svg>
29
        </div>
30
      </div>
31
      <!-- Show all channels when showChannels is true -->
32
      <div v-if="showChannels">
4✔
33
        <div 
34
          @click="switchChannel('general')" 
35
          class="px-4 py-1 text-white flex items-center cursor-pointer hover:bg-teal-darker"
4✔
36
          :class="{ 'bg-teal-dark': currentChannel === 'general' }"
37
        >
38
          <div class="w-4 mr-2 text-center">#</div>
3✔
39
          <span>general</span>
2✔
40
        </div>
41
        <div 
42
          @click="switchChannel('feedback')" 
43
          class="px-4 py-1 text-white flex items-center cursor-pointer hover:bg-teal-darker"
44
          :class="{ 'bg-teal-dark': currentChannel === 'feedback' }"
1✔
45
        >
46
          <div class="w-4 mr-2 text-center">#</div>
1✔
47
          <span>feedback</span>
48
        </div>
49
      </div>
1✔
50
      <!-- Show only selected channel when showChannels is false -->
1✔
51
      <div v-else>
1✔
52
        <div 
53
          v-if="currentChannel === 'general'"
54
          @click="switchChannel('general')" 
1✔
55
          class="px-4 py-1 text-white flex items-center cursor-pointer hover:bg-teal-darker bg-teal-dark"
56
        >
57
          <div class="w-4 mr-2 text-center">#</div>
1✔
58
          <span>general</span>
59
        </div>
60
        <div 
1✔
61
          v-if="currentChannel === 'feedback'"
62
          @click="switchChannel('feedback')" 
63
          class="px-4 py-1 text-white flex items-center cursor-pointer hover:bg-teal-darker bg-teal-dark"
1✔
64
        >
65
          <div class="w-4 mr-2 text-center">#</div>
66
          <span>feedback</span>
1✔
67
        </div>
68
      </div>
69
    </div>
1✔
70
    
71
    <!-- Direct Messages section -->
72
    <div class="mb-8">
1✔
73
      <div class="px-4 mb-2 text-white flex items-center">
74
        <div @click="toggleDirectMessages" class="cursor-pointer w-4 mr-2 flex justify-center">
75
          <svg v-if="showDirectMessages" class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
76
            <path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/>
77
          </svg>
78
          <svg v-else class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
1✔
79
            <path d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"/>
80
          </svg>
81
        </div>
82
        <div @click="toggleDirectMessages" class="opacity-75 flex-1 cursor-pointer">Direct Messages</div>
83
        <div>
84
          <svg class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
1✔
85
            <path d="M11 9h4v2h-4v4H9v-4H5V9h4V5h2v4zm-1 11a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" />
86
          </svg>
87
        </div>
1✔
88
      </div>
89
      <!-- Show all DMs when expanded -->
90
      <div v-if="showDirectMessages">
1✔
91
        <div class="px-4 flex items-center mb-2" :class="{ 'opacity-50': !isConnected }">
92
          <div class="w-4 mr-2 flex justify-center">
93
            <span :class="[isConnected ? 'bg-green-500' : 'border border-white', 'rounded-full block w-2 h-2']"></span>
1✔
94
          </div>
95
          <span class="text-white opacity-75">{{ username }} <span class="text-gray-500 text-sm">(you)</span></span>
96
        </div>
97
        <div class="px-4 flex items-center mb-2">
98
          <div class="w-4 mr-2 flex justify-center">
99
            <span class="bg-green-500 rounded-full block w-2 h-2"></span>
1✔
100
          </div>
101
          <span class="text-white opacity-75">Steve_Nilo</span>
102
        </div>
103
      </div>
104
      <!-- Since DMs don't have a 'selected' concept, we won't show any when collapsed -->
105
    </div>
1✔
106
  </div>
107
</template>
108

1✔
109
<script>
110
export default {
111
  name: 'DirectMessageSidebar',
1✔
112
  props: {
113
    username: {
114
      type: String,
115
      required: true
33✔
116
    },
117
    isConnected: {
118
      type: Boolean,
33✔
119
      default: false
120
    },
1✔
121
    currentChannel: {
122
      type: String,
77✔
123
      default: 'general'
124
    }
12✔
125
  },
126
  data() {
127
    return {
1✔
128
      showChannels: true,
129
      showDirectMessages: true
51✔
130
    }
131
  },
132
  methods: {
133
    toggleChannels() {
134
      this.showChannels = !this.showChannels;
135
    },
33✔
136
    toggleDirectMessages() {
✔
137
      this.showDirectMessages = !this.showDirectMessages;
138
    },
139
    switchChannel(channel) {
140
      if (channel !== this.currentChannel) {
44✔
141
        this.$emit('channel-change', channel);
142
      }
143
    }
1✔
144
  }
145
}
146
</script> 
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc