Move FileIO table labels into marker schemas - #6296
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6296 +/- ##
==========================================
+ Coverage 83.82% 83.87% +0.05%
==========================================
Files 350 353 +3
Lines 37744 37857 +113
Branches 10646 10565 -81
==========================================
+ Hits 31638 31753 +115
+ Misses 5677 5675 -2
Partials 429 429 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
canova
left a comment
There was a problem hiding this comment.
Thanks for the PR! Before I review completely, I see that this PR does 2 main things:
- Adds optional segment syntax to marker labels
- Adds a tableLabel to FileIO markers
It's difficult to review these two changes when they are combined together. Can you please split them into 2 commits?
Done ✅ |
canova
left a comment
There was a problem hiding this comment.
Re the optional segmenting in labels using ``[[ ... ]]`:
I'm a bit unsure about adding more and more label templating features to the marker labels. It feels like it can get out of hand quickly and not that easy to get it right.
Pinging and @mstange and @fqueze in case they feel strongly about it.
One issue that I can see is ternaries and the optional segment conflicts right now. For example [[{marker.data.canceled ? 'cancelled' : 'ok'}]] never prints ok if I understand correctly.
On the other hand, I believe this current behavior of FileIO marker can be implemented using ternaries already, right? I assume it'll be longer, but it saves us from adding more complexity here. What do you think?
Your example does print We cannot have the same behavior with just the ternaries though. The current hardcoded FileIO code omits that entire section when source is empty. Existing ternaries cannot conditionally include the interpolation itself. So, instead of having |
|
@canova Thanks for the review! I've addressed your other comments, however, I am not sure what to do with the increased vocabulary complexity... |
|
Thanks for thinking it through!
Yeah I wasn't fully correct on "never" prints I have two markers, with
You are right on that, but this sounds like a bug to me. We show For example I think this if check should include checking empty strings too: profiler/src/profile-logic/marker-schema.ts Lines 266 to 268 in f8a4b7a Once that's fixed the ternary version of this FileIO marker could be this: Not nice looking but good enough. |
Marker labels pass empty strings to the shared value formatter, which renders them as `(empty)` for tooltip fields. Skip empty strings before formatting label parts so labels can omit them without changing tooltip formatting.
Replace the hardcoded `data.type` branch in the generic label fallback with a template on the FileIO schema.
Thanks for your response, @canova! That should indeed work. Implemented now. |
Main | Deploy preview
Replace the hardcoded
data.typebranch that assembles FileIO table labels with a schema template. Optional segments let the template omit surrounding punctuation when source or filename fields are missing.Closes #6295
Profile with IO enabled