Skip to content

KToolbar cleanup [Companion to KDS#1236]#14618

Draft
nucleogenesis wants to merge 5 commits into
learningequality:developfrom
nucleogenesis:kds-ktoolbar-companion-fixes
Draft

KToolbar cleanup [Companion to KDS#1236]#14618
nucleogenesis wants to merge 5 commits into
learningequality:developfrom
nucleogenesis:kds-ktoolbar-companion-fixes

Conversation

@nucleogenesis
Copy link
Copy Markdown
Contributor

Summary

Companion PR to kolibri-design-system#1236. Updates Kolibri's three KToolbar consumers (AppBar, ImmersiveToolbar, ContentModal) to drop props removed in the KDS cleanup, and adds an explicit backgroundColor: 'transparent' on AppBar to preserve the transparency that the removed type="clear" used to provide.

References

Reviewer guidance

Intentionally zero-behavior-change against the currently-installed KDS version — the companion is safe to land before KDS #1236 ships. Once KDS ships with the removed props, Kolibri will also need a kolibri-design-system version bump (separate PR).

Key things to look at:

  • AppBar.vue:14-21backgroundColor: 'transparent' is intentionally added to :style. KDS Coaches should not be required to be members of the classes for which they are the coach #1236's new KToolbar supplies a $themeTokens.surface background by default; without this override, the AppBar would render a white toolbar instead of letting the wrapper div's themeConfig.appBar.background show through. This preserves the effect of the removed type="clear".
  • ImmersiveToolbar.vue — the prior :textColor="isFullscreen ? 'black' : 'white'" is now color: isFullscreen ? $themeTokens.text : $themeTokens.textInverted inside :style. Matches the theme tokens already used by the nested KIconButton :color bindings. Fine on default theme; worth a quick visual check if your fork uses a non-default palette.
  • ImmersiveToolbar.vue prop removal — the internal showIcon prop is deleted. No caller in this repo ever set it, and its only consumption was the removed :showIcon KToolbar binding.
  • @nav-icon-click was removed from the <KToolbar> binding. The navIconClick emit still fires from the nested KIconButton @click handlers, so ImmersivePage's @navIconClick listener still receives events.

Note on the [TEMP] commit: pins the kolibri-design-system pnpm catalog entry to the KDS PR branch so CI actually builds against the cleanup. Will be reverted to a proper version bump once KDS merges and publishes.

Suggested test paths in a dev run:

  • Any Learn / Library page → verifies AppBar renders with themed background
  • Open a coach immersive page (e.g., exam edit) → verifies ImmersiveToolbar (both isFullscreen=true and false paths)
  • Open a resource content modal → verifies ContentModal
  • Navigate to any learning-activity resource → verifies LearningActivityBar is untouched

AI usage

Used Claude Code to audit downstream KToolbar usage across Kolibri, draft the template edits, catch the AppBar transparency regression during review, and compose this PR body. Verified changes locally.

nucleogenesis and others added 2 commits April 15, 2026 21:05
- AppBar: drop removed props (removeNavIcon, type, removeBrandDivider)
  and add backgroundColor: 'transparent' to :style to preserve the
  prior type="clear" behavior (the wrapper div still supplies the
  themed background)
- ImmersiveToolbar: drop removed props (textColor, type, showIcon,
  @nav-icon-click). Fold textColor into :style using $themeTokens.text
  / $themeTokens.textInverted to match the tokens already used on the
  nested KIconButton :color bindings. Also drops the internal showIcon
  prop declaration — no caller ever set it and the only usage was on
  the removed KToolbar :showIcon binding
- ContentModal: drop showIcon (never was a real KToolbar prop)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Temporary dependency pin so this PR's CI builds against the KDS cleanup
PR before it's released. Must be reverted to a proper version bump
(e.g., 6.0.0) once KDS merges and publishes.

Points the pnpm catalog entry to github:nucleogenesis/kolibri-design-system-1
on branch 1183--ktoolbar-cleanup. Regenerated pnpm-lock.yaml accordingly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added APP: Learn Re: Learn App (content, quizzes, lessons, etc.) DEV: frontend SIZE: small labels Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

npm Package Versions

Merging this PR will publish the following packages to npm:

Package Current New
browserslist-config-kolibri 0.18.0 0.20.0
eslint-plugin-kolibri 1.0.0 1.1.0
kolibri-format 2.1.0 2.3.0

Warning

The following packages have changed files but no version bump:

Package Version Changed files
kolibri-app 1.0.0 1
kolibri-build 1.1.0 1
kolibri-i18n 1.0.0 1
kolibri-jest-config 1.0.0 1
kolibri 0.18.0 19

If these changes affect published code, consider bumping the version.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Copy link
Copy Markdown
Member

@AlexVelezLl AlexVelezLl left a comment

Choose a reason for hiding this comment

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

looks nice, just a comment as a reminder for ourselves that we also need to update the KTooblar usage on ResourceLayout, and we should also be able to remove this deep selector, and these deep selectors on the appbar

…t + CSS class rename)

KDS PR learningequality#1236 picked up additional breaking changes during review that
this branch's earlier migration commit didn't anticipate. Mirror them
on the Kolibri side:

  - #icon slot → #leading-actions, #actions slot → #trailing-actions
    on direct KToolbar children. Updated in AppBar, ContentModal,
    ImmersiveToolbar (also keeping its own outward-facing #actions slot
    name unchanged so its consumers don't have to migrate too), and
    LearningActivityBar (only the two templates that are direct KToolbar
    children — KLabeledIcon's nested #icon slots are untouched).
  - /deep/ .k-toolbar-nav-icon → /deep/ .k-toolbar-leading-actions in
    the matching SCSS rules (ImmersiveToolbar, LearningActivityBar).
  - Drop ImmersiveToolbar's /deep/ .k-toolbar-title { text-overflow:
    ellipsis; } rule — KToolbar now bakes in title truncation via
    KTextTruncator, so the workaround is redundant.

Out of scope here, tracked separately:
  - The wholesale /deep/ removal across the repo (190 usages); the
    remaining /deep/ .k-toolbar-* rules in these files stay for now.
  - AppBar.vue's sub-nav migration to KToolbar's new #extension slot
    (needs a redesign of the dual-render Navbar overflow logic).
Drops the wrapper div that was supplying the toolbar's themed background
(backgroundColor moves directly onto KToolbar's :style), moves the
sub-nav Navbar from a sibling 'subpage-nav' div into KToolbar's new
#extension slot, and removes the duplicate inline Navbar that was living
in the #navigation slot for overflow measurement.

Also drops the dual-render plumbing that supported the now-defunct
measurement copy: overflowCount data, showTopNavBar computed, and
hiddenNavbarStyle computed. The single Navbar instance in #extension
gets full container width and computes its own overflow without needing
a measurement twin.
Lockfile was pinned to afa62dac4 — a SHA that no longer exists on the
KDS branch after force-pushes. Updates to ba795be36 (current tip).
Tests that were failing because the locally-installed KDS still had
the old #icon/#actions slot names now pass.

Will be reverted to a published version bump once KDS PR learningequality#1236 lands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APP: Learn Re: Learn App (content, quizzes, lessons, etc.) DEV: frontend SIZE: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants