-
Notifications
You must be signed in to change notification settings - Fork 568
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
Add created date to the note info panel #2585
Conversation
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.
Looks straightforward to me; nice quick fix.
Maybe double-check with @codebykat before merging so she has a chance to review.
Thanks @dmsnell! I just pushed another commit breaking out the note info items in the panel to their own component to reduce a bunch of repeated HTML. |
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.
The value of splitting out the note info items into new components and then wrapping a helper function is debatable. We might end up regretting having to jump around so much in order to understand what output is being rendered.
Personally I find it clearer the way it was, but if we do want to split it apart then I think it would be much less confusing if we did it inline inside of the render()
function. This is largely because the new component isn't some kind of general-purpose component we can use in various places; it's a specific component that does almost nothing but carries with it very specific CSS.
The same goes for the time tag - I'd rather see the duplication in the code so I know what exactly it produces and how. Maybe that one is more generic than the note info item. How many places around the app do we create a timestamp with this specific format, with this specific HTML tag? If a number of places then I'd see that being a better candidate for extraction into a new component (though to be clear I think it's fine inline).
|
||
type Props = { | ||
noteDetails?: String | FunctionComponent | null; | ||
noteName?: String; |
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.
these props are already namespaces by means of being props for this component. you can see my other comment questioning the value of creating this component, but if we do then details
and name
would be sufficient unless you have a reason they need to be prefixed. it's awkward below when calling it since noteName
and noteDetails
don't stick out as being related to what it's used for.
Thanks so much @dmsnell. I wasn't sure when it would be best to split out. I saw multiple items that ll looked and worked almost the same and thought it may be easier to read to move them out and pass in props instead. I'll take a look again tomorrow and revert it back to how I had it at first. Regarding the naming you mentioned above, I can't seem to duplicate it now, but I was getting an error somewhere when using just the name |
735783a
to
182e895
Compare
About the time tag that was mentioned above. In a previous commit, I had added a helper function that would generate the time tag used here. This format is only used in a couple of places so I would say it is fine like @dmsnell said to leave the bit of code duplication. I'll leave things as-is for now. |
182e895
to
d4e7f71
Compare
To sum up from our chat, I think for now we should leave the duplicate code, and merge this as it was, but with one small change: move the |
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.
This is looking and working great! There's one class missing that makes the note detail a lighter shade to match the others.
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.
[testing] verified on Win10 | desktop SN 2.6.0-beta1 |
Fix
The note info panel didn't display the created date for a note as mentioned in #2506 as well as in our feature request tracker.
This pull request adds the created date below the last modified date in the note info panel.
Test
Screenshot
Release