Skip to content

[Remove Vuetify from Studio] Add StudioContentNodeIcon to channel details Total resources (#5933) - #6385

Open
vtushar06 wants to merge 2 commits into
learningequality:unstablefrom
vtushar06:studio-content-node-icon-5933
Open

vtushar06 wants to merge 2 commits into
learningequality:unstablefrom
vtushar06:studio-content-node-icon-5933

Conversation

@vtushar06

Copy link
Copy Markdown
Contributor

Summary

Removes the Vuetify dependency from the content kind icons in the channel details modal (Total resources section) by adding a Vuetify-free StudioContentNodeIcon, as a parallel to ContentNodeIcon.

Changes:

  • Added getContentKindColor in shared/utils/colors.js, mapping content kinds to KDS theme colors (tokens.watch / listen / read / practice / explore, and palette.grey.v_400 for folders and unknown kinds)
  • Added StudioContentNodeIcon (shared/views/StudioContentNodeIcon.vue), built on KIcon + getContentKindIcon from shared/utils/icons.js. Keeps capture-as-image so the PDF channel summary still rasterises the icons
  • Swapped ContentNodeIcon → StudioContentNodeIcon in StudioDetailsPanel Total resources only
  • ContentNodeIcon and shared/vuetify/theme.js are untouched; no other areas refactored

Notes / open questions:

  • h5p maps to the html5 icon in shared/utils/icons.js. unsupported maps to the KDS error icon (base Vuetify uses error_outline, which KDS does not export). Any other missing kind still throws, and StudioContentNodeIcon no longer catches that error.
  • Only the kind and isEmpty props are carried over; includeText, showColor, fillWidth and small aren't used in the details panel so I left them out to keep scope tight. Can add them if wanted for future sub-issues

Screenshots:
Published Channel, dev server, a@a.com. Background colours match on both sides (exercise #6986f7, audio #ff7f8d, document #ff4324, HTML5 #ff7600, video #33acf5). The after chips use KDS icons at a 4px radius instead of Vuetify Material chips at 2px; the kinds, labels, and counts are the same. The clipped Arabic PDF layout is already present on unstable.

Before (unstable) After (remove-vuetify-5933)
Total resources, LTR Total resources on unstable, LTR Total resources after StudioContentNodeIcon, LTR
Channel summary PDF, LTR PDF summary on unstable, LTR PDF summary after StudioContentNodeIcon, LTR
Total resources, Arabic RTL Total resources on unstable, Arabic RTL Total resources after StudioContentNodeIcon, Arabic RTL
Channel summary PDF, Arabic RTL PDF summary on unstable, Arabic RTL PDF summary after StudioContentNodeIcon, Arabic RTL

References

Closes #5933
Sub-issue of #5060

Reviewer guidance

  • Run pnpm test colors StudioContentNodeIcon StudioDetailsPanel — 30 tests pass
  • Login as a@a.com / a → Channels > My Channels → info icon on the Published Channel card → check the Total resources icons
  • Download channel summary > Download PDF → icons should still appear in the PDF

AI usage

@vtushar06
vtushar06 requested review from a team and leq-bot November 12, 2026 13:04
@learning-equality-bot

Copy link
Copy Markdown
Contributor

👋 Hi @vtushar06, thanks for contributing!

For the review process to begin, please verify that the following is satisfied:

  • Contribution is aligned with our contributing guidelines

  • Pull request description has correctly filled AI usage section & follows our AI guidance:

    AI guidance

    State explicitly whether you didn't use or used AI & how.

    If you used it, ensure that the PR is aligned with Using AI as well as our DEEP framework. DEEP asks you:

    • Disclose — Be open about when you've used AI for support.
    • Engage critically — Question what is generated. Review code for correctness and unnecessary complexity.
    • Edit — Review and refine AI output. Remove unnecessary code and verify it still works after your edits.
    • Process sharing — Explain how you used the AI so others can learn.

    Examples of good disclosures:

    "I used Claude Code to implement the component, prompting it to follow the pattern in ComponentX. I reviewed the generated code, removed unnecessary error handling, and verified the tests pass."

    "I brainstormed the approach with Gemini, then had it write failing tests for the feature. After reviewing the tests, I used Claude Code to generate the implementation. I refactored the output to reduce verbosity and ran the full test suite."

📢✨ Before we assign a reviewer:

  • @rtibblesbot will pre-review this pull request. Its comments are generated by an LLM, and should be evaluated accordingly.
  • We'll also invite community pre-review. See the community review guidance for both authors and reviewers.

Also check that issue requirements are satisfied & you ran pre-commit locally.

Pull requests that don't follow the guidelines will be closed.

Reviewer assignment can take up to 2 weeks.

@rtibblesbot

rtibblesbot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Waiting for changes

Outcome: reviewed ceb40ec

Last updated: 2026-11-12 13:14 UTC

@rtibblesbot rtibblesbot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR #6385: the component and the StudioDetailsPanel swap look right. Two suggestions about unknown kinds.

  • CI is failing: linting (pre-commit), Javascript tests, Python tests, Container Build, and Build and deploy. The logs did not show the failing step. Please check the linting run first.
  • Manual QA did not run. Chip size and colours are unchecked in the browser.

Next step: Needs a full code review by a human engineer, then manual QA once that reviewer sets Needs QA.

  • The author is outside the team: confirm this should be built at all.
  • User-visible files changed: contentcuration/contentcuration/frontend/shared/utils/colors.js, contentcuration/contentcuration/frontend/shared/utils/icons.js, contentcuration/contentcuration/frontend/shared/views/StudioContentNodeIcon.vue, contentcuration/contentcuration/frontend/shared/views/details/StudioDetailsPanel.vue.
  • Check that the Total resources icons in channel details match the old chip's size, colour and alignment for every kind, including h5p.

Written by rtibblesbot, an LLM-based coding agent.

[ContentKindsNames.ZIM]: 'html5',
// Not a content kind. Base Vuetify uses error_outline; KDS has no such token.
// Unknown kinds still throw below.
unsupported: 'error',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: The unsupported pseudo-kind sits in a map shared with Thumbnail.vue and StudioThumbnail.vue. Only the new component uses it. Suggest keeping the h5p mapping here and handling the unsupported fallback in StudioContentNodeIcon (see the comment there). If you keep the key, drop line 16: it restates the throw below.

},
computed: {
icon() {
return getContentKindIcon(this.kind, this.isEmpty);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: Any kind outside the map throws here and breaks the render. The kind validator only warns, so it does not stop this. ContentNodeIcon falls back to error_outline instead (shared/vuetify/icons.js:28). Suggest falling back to the unsupported icon for unknown kinds. After that, v-if="icon" on line 4 is always true and can go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Remove Vuetify from Studio] Create StudioContentNodeIcon and use it channel details modal

2 participants