Skip to content

Fix category chip tooltips always visible; earlier fade-out; variable name collision#102

Draft
Copilot wants to merge 25 commits into
experimentalfrom
copilot/redesign-category-item-cards
Draft

Fix category chip tooltips always visible; earlier fade-out; variable name collision#102
Copilot wants to merge 25 commits into
experimentalfrom
copilot/redesign-category-item-cards

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 1, 2026

Three related fixes to category badge/chip rendering in item cards.

Variable name collision (lib/externlib.php)

$fullpath was both the closure and the loop variable — overwriting the closure on the first iteration caused a "call to undefined function" error on subsequent rows. Renamed the result to $label.

Tooltips always shown (lib/externlib.php, view_items.php)

Tooltip attributes (data-bs-toggle, data-bs-placement, data-bs-title) were only added when count($parts) > 1, so root-level categories showed no hover info. Removed the guard — tooltips are now unconditional.

// Before
$attrs = ['class' => 'badge badge-secondary'];
if (count($parts) > 1) {
    $attrs['data-bs-toggle'] = 'tooltip';
    $attrs['data-bs-title'] = $fullpath;
}

// After
$attrs = [
    'class'              => 'badge badge-secondary',
    'data-bs-toggle'     => 'tooltip',
    'data-bs-placement'  => 'top',
    'data-bs-title'      => $label,
];

Earlier fade-out (css/eportfolio-cards.css)

The right-edge fade mask started at 85%, leaving little visible signal that chips were being clipped. Moved to 70% for a more prominent cue.

Original prompt

Redesign: Category and item cards to match the new eportfolio card design

Overview

Rewrite the Bootstrap card templates for categories (folders) and items (artefacts) in view_items.php to exactly match the new card design as defined in the reference HTML and CSS files below. Also add the CSS from eportfolio-style.css into the plugin's CSS and load it.


Reference design files

CSS — eportfolio-style.css (to be saved as css/eportfolio-cards.css in the repo)

#exaport .tertiary-exabis-navigation {
    padding-bottom: 25px;
}
#exaport .tertiary-exabis-navigation .navigation {
    border-bottom: 1px solid var(--bs-border-color);
    background-color: #fff;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}
#exaport .exaport-portfolio-toolbar .input-group,
#exaport .exaport-portfolio-toolbar .form-select {
    width: 100%;
}
#exaport .exaport-portfolio-toolbar .icon {
    margin-right: 0;
}
#exaport .card-eportfolio .card-top {
    padding: 1rem 1rem 0 1rem;
}
#exaport .card-eportfolio .card-title {
    line-height: 1.4;
}
#exaport .card-eportfolio .card-title a:hover,
#exaport .card-eportfolio .card-title a:focus {
    text-decoration: none;
    outline: 0 !important;
    box-shadow: none !important;
}
#exaport .card-eportfolio .card-title .icon {
    color: #000;
    color: rgba(0, 0, 0, 0.796);
}
#exaport .card-eportfolio .card-body {
    padding: .5rem 1rem 1rem 1rem;
}
#exaport .card-eportfolio .eportfolio-categories {
    font-size: .8rem;
}
#exaport .card-eportfolio .eportfolio-categories .badge {
    font-size: .72rem;
    background-color: #e9ecef !important;
}
#exaport .card-eportfolio .eportoflio-share .icon {
    margin-right: 0;
}
#exaport .card-eportfolio .eportoflio-share .icon.icon-shared,
#exaport .card-eportfolio .eportoflio-comment .icon.icon-comment {
    margin-right: .2rem;
}
#exaport .card-eportfolio .eportoflio-date,
#exaport .card-eportfolio .eportfolio-share-count,
#exaport .card-eportfolio .eportfolio-comment-count {
    font-size: .8rem;
}
#exaport .eportfolio-card-more .dropdown-toggle {
    color: #000;
}
#exaport .eportfolio-card-more .dropdown-toggle:after {
    content: "";
    display: none;
}
#exaport .col-card-collection-group {
    position: relative;
}
#exaport .card-collection-outer {
    position: relative;
}
#exaport .card-eportfolio {
    position: relative;
    z-index: 3;
    background: #fff;
    border: .0625rem solid rgba(0,0,0,.175);
    border-radius: .5rem;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
#exaport .card-stack-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    border: .0625rem solid rgba(0,0,0,.175);
    border-radius: .5rem;
    pointer-events: none;
}
#exaport .card-stack-layer-1 {
    top: -.2rem;
    left: .2rem;
    z-index: 2;
}
#exaport .card-stack-layer-2 {
    top: -.4rem;
    left: .4rem;
    z-index: 1;
    box-shadow: 2px 2px 4px rgba(0,0,0,.15);
}
#exaport .col-card-folder .card-eportfolio {
    position: relative;
    border-radius: 0 0.75rem 0.75rem 0rem;
    margin-top: 1.2rem;
}
#exaport .col-card-folder .card-eportfolio::before {
    content: "";
    position: absolute;
    top: -1.15rem;
    left: -1px;
    width: 8rem;
    height: 1.2rem;
    background: var(--bs-card-bg, #fff);
    border: var(--bs-card-border-width, 1px) solid var(--bs-card-border-color, rgba(0,0,0,.175));
    border-radius: 0.75rem 0.75rem 0 0;
    background-color: #efefef;
    border-bottom: 0;
}
#exaport .col-card-folder .card-eportfolio::after {
    content: "";
    position: absolute;
    top: -1.15rem;
    left: 6.7rem;
    width: 2.2rem;
    height: 1.2rem;
    background: var(--bs-card-bg, #fff);
    border-top: var(--bs-card-border-width, 1px) solid var(--bs-card-border-color, rgba(0,0,0,.175));
    border-right: var(--bs-card-border-width, 1px) solid var(--bs-card-border-color, rgba(0,0,0,.175));
    transform: skewX(35deg);
    transform-origin: left bottom;
    border-radius: 0 0.45rem 0 0;
    background-color: #efefef;
}
#exaport .col-card-folder .card-eportfolio {
    height: calc(100% - 1.2rem) !important;
}
.tooltip .tooltip-inner {
    text-align: left;
}
.tooltiplist {
    margin: 0;
    padding-left: 1rem;
}
.tooltiplist li {
    margin: 0;
    padding: 0;
}
#exaport .exaport-category-view .badge {
    font-size: 0.70rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.7rem;
}
#exaport .eportfolio-categories .badge {
    font-size: .78rem;
}

Reference HTML — folder card (card-folder.php)

<div class="col col-card-folder">
  <div class="card card-eportfolio h-100">
    <div class="card-top d-flex justify-content-end">
      <span class="eportfolio-card-more">
        <a class="dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
          <i class="fa-regular fa-ellipsis-vertical fa-fw" aria-hidden="true"></i>
        </a>
        <ul class="dropdown-menu d...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

Copilot AI changed the title [WIP] Rewrite Bootstrap card templates for categories and items Redesign folder/category cards and folder-mode item cards to match new ePortfolio card spec Jun 1, 2026
Copilot AI requested a review from richardwolfmayr June 1, 2026 13:54
Copilot AI changed the title Redesign folder/category cards and folder-mode item cards to match new ePortfolio card spec refactor: replace PHP string-concat card rendering with Mustache templates in view_items.php Jun 1, 2026
Copilot AI changed the title refactor: replace PHP string-concat card rendering with Mustache templates in view_items.php Use FA6 Free-only icons; inline fixed icons in mustache templates Jun 2, 2026
Copilot stopped work on behalf of richardwolfmayr due to an error June 2, 2026 10:26
Copilot AI changed the title Use FA6 Free-only icons; inline fixed icons in mustache templates Fix inconsistent card-footer height between category and item tiles Jun 2, 2026
Copilot AI changed the title Fix inconsistent card-footer height between category and item tiles Refactor bootstrap card rendering into Moodle output classes; move utility functions to lib Jun 2, 2026
Copilot AI changed the title Unify artefact/category card design and enforce consistent tile height Unify card design across folder/flat views with fixed height and separate text/chips zones Jun 2, 2026
Copilot AI changed the title Unify card design across folder/flat views with fixed height and separate text/chips zones Show item categories as badges in shared_item.php detail view Jun 2, 2026
Copilot AI changed the title Show item categories as badges in shared_item.php detail view Show categories on item detail page; trim badge labels to leaf segment Jun 2, 2026
Copilot AI changed the title Show categories on item detail page; trim badge labels to leaf segment Category badges: show last segment only, Bootstrap tooltip on hover, fix cursor Jun 2, 2026
Copilot AI changed the title Category badges: show last segment only, Bootstrap tooltip on hover, fix cursor Fix closure overwritten by its own return value in category badge loop Jun 2, 2026
Copilot AI changed the title Fix closure overwritten by its own return value in category badge loop Fix category chip tooltip visibility and fade-out clipping cue Jun 2, 2026
Copilot AI changed the title Fix category chip tooltip visibility and fade-out clipping cue Fix category chip tooltips always visible; earlier fade-out; variable name collision Jun 2, 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.

2 participants