Skip to content

Fix channels admin filters#5742

Open
AlexVelezLl wants to merge 3 commits intolearningequality:unstablefrom
AlexVelezLl:fix-admin-filters
Open

Fix channels admin filters#5742
AlexVelezLl wants to merge 3 commits intolearningequality:unstablefrom
AlexVelezLl:fix-admin-filters

Conversation

@AlexVelezLl
Copy link
Member

Summary

  • Filter out deleted channels on "unlisted" channels filters.
  • Adds a dedicated deleted filter for "unlisted" channels filters.
  • Adds an "all channels" channel type filter.
Grabacion.de.pantalla.2026-03-04.a.la.s.4.12.09.p.m.mov

References

Closes #5580.
Closes #5581.

Reviewer guidance

  • Go to admin > channels.
  • Play with channels filters.

@AlexVelezLl AlexVelezLl requested a review from rtibblesbot March 4, 2026 21:13
Copy link

@rtibblesbot rtibblesbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean implementation that meets both linked issues' acceptance criteria.

CI: only the spreadsheet workflow has run (passed); other checks still pending. Video demo confirms the filters work as expected — "All Channels" is the default, channel type is non-clearable, status filters are always enabled, and deleted channels are properly filtered.

  • praise: Good introduction of ChannelTypeFilter enum and use of CommunityLibraryStatus constants — eliminates magic strings and makes the filter logic self-documenting.
  • praise: The defaultValue addition to useFilter is a clean, minimal extension of the composable.
  • praise: Adding { immediate: true } to the channelTypeFilter watcher ensures the status filter is correctly initialized on first load.

@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?

Reviewed the pull request diff checking for:

  • Correctness: bugs, edge cases, undocumented behavior, resource leaks, hardcoded values
  • Design: unnecessary complexity, naming, readability, comment accuracy, redundant state
  • Architecture: duplicated concerns, minimal interfaces, composition over inheritance
  • Testing: behavior-based assertions, mocks only at hard boundaries, accurate coverage
  • Completeness: missing dependencies, unupdated usages, i18n, accessibility, security
  • Principles: DRY (same reason to change), SRP, Rule of Three (no premature abstraction)
  • Checked CI status and linked issue acceptance criteria
  • For UI changes: inspected screenshots for layout, visual completeness, and consistency

import { CommunityLibraryStatus } from 'shared/constants';

const ChannelTypeFilter = {
ALL: 'all',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Good use of a ChannelTypeFilter enum to replace the previous magic strings ('kolibriStudio', 'community', 'unlisted'). This makes the filter logic easier to follow and less error-prone.

const routeFilter = route.query[name];
const filterOption = options.value.find(option => option.value === routeFilter);
return filterOption || {};
return filterOption || options.value.find(option => option.value === defaultValue) || {};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Clean fallback chain — try the route query param first, then the default value, then empty object. Minimal change that adds defaultValue support without disrupting existing callers.

channelStatusFilter.value = options.length ? options[0].value : null;
},
{ immediate: true },
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Adding { immediate: true } here is important — without it, the status filter wouldn't be initialized on first render when channelTypeFilter defaults to ALL. Good catch.

@AlexVelezLl AlexVelezLl requested review from rtibbles March 4, 2026 21:18
@rtibbles rtibbles self-assigned this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESoCC: Deleted channels not being taken into account in the admin channels table ESoCC: Add new "All channels" filter for the admin channels table

3 participants