-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: ComputedProperty Dependent keys in debugger & services highlighting #781
Feature: ComputedProperty Dependent keys in debugger & services highlighting #781
Conversation
Just playing with some ideas. In this mockup I went the Apple route (Safari and Xcode) with icons that just have a letter. Not sure if this is a good idea for people where English isn't their first language. But overall I think it's easily scannable by the eyes. I do want to be careful not to make the Object Inspector too busy. A variation without lines: Another: |
This is a fantastic, very useful feature! However, I believe displaying dependency trees inline is inefficient, since they can be arbitrarily deep and branchy. I'd rather have a button next to each CP that would pop up a modal with a full-screen interactive dependency tree, similar to how @lahmatiy's Basis.JS does it: However, I don't remember seeing any modals in Ember Inspector, and I'm not sure if it's even possible. |
@nummi codepen for icons path? |
Makes sense. Maybe the immediate dependency is okay for a first pass? |
ember_debug/object-inspector.js
Outdated
options.dependentKeys = hash[prop]._dependentKeys; | ||
if (!options.isService) { | ||
try { | ||
options.code = hash[prop]._getter.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you always expect this to be a function, could you essentially do Function.prototype.toString.call(hash[prop]._getter)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwjblue no luck( Tests not passed
app/styles/object_inspector.scss
Outdated
@@ -10,3 +10,107 @@ | |||
margin-left: 39px; | |||
word-break: break-all; | |||
} | |||
|
|||
:root { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not here, but in the top of the file?
app/styles/object_inspector.scss
Outdated
} | ||
|
||
.mixin__property-dependency-item:first-child::before { | ||
background: url('data:image/svg+xml;utf8,<svg width="17" height="15" version="1" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" stroke="#979797"><circle cx="13" cy="11" r="3"/><path d="M13 8c0-3-1-4-4-4H5C2 4 1 3 1 0"/></g></svg>') no-repeat; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try
background: url('data:image/svg+xml;utf8,<svg width="17" height="15" xmlns="http://www.w3.org/2000/svg"><g transform="translate(1)" stroke="#979797" fill="none" fill-rule="evenodd"><circle fill="#FFF" cx="12" cy="11" r="3"/><path d="M12 8c0-3-1-4-4-4H4C1 4 0 3 0 0"/></g></svg>') no-repeat;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data:image/svg+xml;utf8,<svg
doesn't seem to working for me in Firefox
app/styles/object_inspector.scss
Outdated
.mixin__property-dependency-item::before { | ||
content: ""; | ||
display: block; | ||
background: url("data:image/svg+xml;utf8,<svg width='8' height='16' xmlns='http://www.w3.org/2000/svg'><g transform='translate(-14 -16)' stroke='#979797' fill='none' fill-rule='evenodd'><circle cx='18' cy='28' r='3'/><path d='M18 24.571V16.5'/></g></svg>") no-repeat; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Longer arrow and white circle
<svg width="8" height="20" xmlns="http://www.w3.org/2000/svg"><g transform="translate(1 -1)" stroke="#979797" fill="none" fill-rule="evenodd"><circle fill="#FFF" cx="3" cy="17" r="3"/><path d="M3 13.571V1.489649"/></g></svg>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6e3c35a
to
c04384d
Compare
It’s ready for review |
@rwwagner90 new tests added |
@lifeart, is toggling the display of the dependencies broken? Clicking the "C" isn't working for me. |
@nummi, (it's fixed in my last commit with tests), Openable "C" property must have bold name. If name not "bold" - no dependent keys |
After 5 mins of comparing I can't say that my eyes tired about implemented part. |
I agree with @nummi here:
PS Dependency listings are awesome! Are they clickable? |
Nope, right now they not clicable, there is some reasons for it:
|
app/styles/object_inspector.scss
Outdated
padding: 0; | ||
list-style: none; | ||
display: block; | ||
// margin-bottom: 0.2em; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgotten comment.
prop.dependentKeys = options.dependentKeys || []; | ||
let hasServiceFootprint = prop.value && typeof prop.value.inspect === 'string' ? prop.value.inspect.includes('@service:') : false; | ||
prop.isService = options.isService || hasServiceFootprint; | ||
prop.code = options.code; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add tests for services and DKs here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@teddyzeenny done
e38f033
to
cf31208
Compare
tests for cp-expand & service highlight valueType alias css comment removal cp deps and service serialization keys test is service detection update
cf31208
to
8a496c5
Compare
@lifeart, I have my own branch for playing with the UI. I have everything lined up and the SVG rendering pixel perfect. Let me know if you want to integrate this code. (working with SVG and this small of a scale is a nightmare) |
I agree with @nummi that new UI looks more heavy, but let's compare new proposal on the same screen, with more elements |
@nummi, looks awesome! Sure, I want to integrate it! Could you open pr against https://github.com/lifeart/ember-inspector/tree/computed-dependent-keys and I will mege it, to add your stuff to this PR |
Hey! What's the status of this? I'm planning to release the inspector this weekend, do you think it can make it? |
@teddyzeenny I'm waiting for @nummi PR, for me all looks good |
@teddyzeenny @lifeart, getting my commit ready now. |
@teddyzeenny @lifeart, here is the PR: Tested in Firefox and Chrome on macOS. |
@nummi @teddyzeenny, merged, waiting for green CI flag |
@nummi @teddyzeenny all green, I think thi PR ready for acceptance |
Dismissing old review, since changes were made
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for all the hard work! 🎉
Congrats! Though this question was left unanswered:
|
The letter icons are more about consistency. We are highlighting services in addition to computed properties; we struggled with an icon for services and two styles of icons looked even more busy. I guess we'll see how the community Reacts. Maybe I've been staring at the new design too long but I think it works well when looking at the inspector as a whole. |
#779
it will be greate to get some view-component like
http://basisjs.com/basisjs/demo/data/data-flow.html
emberjs/ember.js#16478