Skip to content

Commit

Permalink
tableTraceRow - don't markup undefined
Browse files Browse the repository at this point in the history
javascript - fix .interface selector
tweak css
  • Loading branch information
bkdotcom committed Feb 8, 2025
1 parent f3a87b6 commit 6be345d
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ It is installable and autoloadable via [Composer](https://getcomposer.org/) as [
```json
{
"require": {
"bdk/debug": "^3.3",
"bdk/debug": "^3.4",
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions src/Debug/Dump/Html/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function tableAddContextRow($html, array $row, array $rowInfo, $index)
}

/**
* Format trace table's function column
* Format trace table's filepath & function columns
*
* @param string $html <tr>...</tr>
* @param array $row Row values
Expand All @@ -228,7 +228,7 @@ public function tableTraceRow($html, array $row, array $rowInfo)
|xs', $html, $cells, PREG_SET_ORDER);

$cells[1]['innerHtml'] = $this->markupFilePath($row['file'], $rowInfo['commonFilePrefix']);
if (isset($cells[3])) {
if (isset($cells[3]) && $row['function'] !== Abstracter::UNDEFINED) {
$cells[3]['innerHtml'] = $this->dumper->valDumper->markupIdentifier($row['function'], 'method', 'span', array(), true);
}
$trAttribs = \strpos($cells[1]['innerHtml'], 'DOCUMENT_ROOT') !== false
Expand Down
2 changes: 1 addition & 1 deletion src/Debug/css/Debug.css

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/Debug/js/Debug.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@

function enhanceInterfaces ($obj) {
var $inner = $obj.find('> .object-inner');
$inner.find('> dd > ul > li > .interface, > dd > ul > li > .interface + ul .interface')
$inner.find('> dd.interface, > dd.implements .interface')
.each(function () {
var iface = $(this).text();
if (findInterfaceMethods($obj, iface).length === 0) {
Expand Down Expand Up @@ -6184,7 +6184,8 @@

function refTitleImplements ($ref, title) {
var className = $ref.parent().data('implements');
var $interface = $ref.closest('.object-inner').find('> .implements span[data-interface]').filter(function ($node) {
var selector = '> dd.interface, > dd.implements .interface';
var $interface = $ref.closest('.object-inner').find(selector).filter(function ($node) {
return $(this).data('interface') === className
});
return title + ' ' + $interface[0].innerHTML
Expand Down
2 changes: 1 addition & 1 deletion src/Debug/js/Debug.jquery.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/Debug/js_src/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ function refTitleDeprecated ($ref, title) {

function refTitleImplements ($ref, title) {
var className = $ref.parent().data('implements')
var $interface = $ref.closest('.object-inner').find('> .implements span[data-interface]').filter(function ($node) {
var selector = '> dd.interface, > dd.implements .interface';
var $interface = $ref.closest('.object-inner').find(selector).filter(function ($node) {
return $(this).data('interface') === className
})
return title + ' ' + $interface[0].innerHTML
Expand Down
2 changes: 1 addition & 1 deletion src/Debug/js_src/enhanceObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function enhanceInner ($obj) {

function enhanceInterfaces ($obj) {
var $inner = $obj.find('> .object-inner')
$inner.find('> dd > ul > li > .interface, > dd > ul > li > .interface + ul .interface')
$inner.find('> dd.interface, > dd.implements .interface')
.each(function () {
var iface = $(this).text()
if (findInterfaceMethods($obj, iface).length === 0) {
Expand Down
6 changes: 5 additions & 1 deletion src/Debug/scss/_arrayAndObject.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ li[class*=m_] > .t_array.array-file-tree > .array-inner {
margin-left: -10px;
}

.t_identifier[title] {
.t_identifier[title],
.t_identifier.hasTooltip {
border-bottom: currentColor dashed 1px;
}

Expand Down Expand Up @@ -135,6 +136,9 @@ li[class*=m_] > .t_array.array-file-tree > .array-inner {
> .modifiers {
display: none;
}
> dd {
width: fit-content;
}
> dd[class*=t_modifier_] {
display: inline-block;
margin-left: 0;
Expand Down
8 changes: 4 additions & 4 deletions src/Debug/scss/_debugMenuBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// xdebug-menu-bar
.debug-bar {
position: relative;
padding: 5px;
font-size: 115%;
background-color: rgba(0, 0, 0, 0.2);
margin-bottom: 10px;
// padding: 5px;
// font-size: 115%;
// background-color: rgba(0, 0, 0, 0.2);
// margin-bottom: 10px;
a {
color: var(--color-fg-2);
}
Expand Down
4 changes: 3 additions & 1 deletion src/Debug/scss/_misc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
.hasTooltip:not(a),
*[title]:not(a) {
cursor: help;
&:hover { background-color: rgba(0, 0, 0, 0.05); }
&:hover {
background: color-mix(in lch, var(--color-button-fg) 20%, transparent);
}
}

*[data-toggle] {
Expand Down
9 changes: 6 additions & 3 deletions src/Debug/scss/_script.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ i.fa-calendar { font-size: 1.1em; }
}

.vis-toggles span:hover,
[data-toggle=interface]:hover { background-color: rgba(0, 0, 0, 0.1); }
[data-toggle=interface]:hover {
background: color-mix(in lch, var(--color-button-fg) 20%, transparent);
}

.vis-toggles .toggle-off,
.interface {
&.toggle-off { opacity: 0.5; }
.interface.toggle-off,
.interface.toggle-off * {
color: color-mix(in lch, var(--color-fg) 50%, transparent);
}

//
Expand Down

0 comments on commit 6be345d

Please sign in to comment.