CtrlK
BlogDocsLog inGet started
Tessl Logo

pubnub/pubnub-chat

Build chat applications with PubNub Chat SDK

Does it follow best practices?

Evaluation100%

1.14x

Agent success when using this tile

Validation for skill structure

Overview
Skills
Evals
Files

task.mdevals/scenario-5/

Channel Sidebar with Unread Badges

Context

You are building the channel sidebar for a PubNub Chat SDK-based messaging application. The sidebar shows all channels the current user belongs to, along with a badge indicating how many new messages they have not yet seen in each channel. When a user opens a channel, the badge should clear by recording that the user has seen the latest content. The sidebar also needs to load recent messages when a channel is selected.

Task

Write a JavaScript module (channel-sidebar.js) that provides:

  1. A function to fetch all channels the current user is a member of, along with the number of unseen messages in each
  2. A function to mark a channel as fully seen by the current user
  3. A function to load the most recent messages for a selected channel, with the ability to load older messages for scrollback

Assume a Chat SDK instance is passed into each function.

Expected Outputs

  • A channel-sidebar.js file with functions for building a channel sidebar with unseen message tracking and message loading.

Install with Tessl CLI

npx tessl i pubnub/pubnub-chat

evals

SKILL.md

tile.json