Skip to content
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

Dedicated title/description input fields #22

Closed
kirillt opened this issue Oct 21, 2023 · 13 comments
Closed

Dedicated title/description input fields #22

kirillt opened this issue Oct 21, 2023 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@kirillt
Copy link
Member

kirillt commented Oct 21, 2023

If user edits the content with empty title, title should reflect first 20 characters of the content.

When the user overwrites the title, it stops reflecting the content.

User should be able to create a description, too. But it should be hidden by default.

@kirillt kirillt added the enhancement New feature or request label Oct 21, 2023
@tuancoltech tuancoltech self-assigned this Nov 15, 2023
@shubertm
Copy link
Member

shubertm commented Dec 4, 2023

Partially solved in #19
Title field added
Description field not added
There was a change in the default title implementation. We no longer get it from the content. Default title is created as Note $timestamp

@tuancoltech
Copy link
Collaborator

Partially solved in #19 Title field added Description field not added There was a change in the default title implementation. We no longer get it from the content. Default title is created as Note $timestamp

@ShubertMunthali Thank you ~

@shubertm
Copy link
Member

shubertm commented Dec 5, 2023

Title and description should be persisted separate from content when save is clicked, this is to allow editing title and description independently. Right now they are not independent even though they are stored in separate storage.
And @kirillt could you please describe the new design of this feature

@kirillt
Copy link
Member Author

kirillt commented Dec 7, 2023

@ShubertMunthali I don't think title and description really myst be stored in separate storages. Single json storage for any extra data should be fine. What do you mean by dependency between title and description? It doesn't seem to be an issue

@kirillt
Copy link
Member Author

kirillt commented Dec 7, 2023

This issue is mostly about logic of the UI. When a user creates a note, we wait until we have 20+ characters of the content and take it as the title. More sophisticated logic could be applied, too.

No need to implement continuous tracking of the content to update the title, it seems to be over-engineering to me.

@shubertm
Copy link
Member

shubertm commented Dec 7, 2023

@ShubertMunthali I don't think title and description really myst be stored in separate storages. Single json storage for any extra data should be fine. What do you mean by dependency between title and description? It doesn't seem to be an issue

@kirillt What I mean is, right now saving title and description is tied to save content. (title and description) are dependent on content in terms of saving logic. But they are stored in separate storage from content, not from each other :)

@shubertm
Copy link
Member

shubertm commented Dec 7, 2023

This issue is mostly about logic of the UI. When a user creates a note, we wait until we have 20+ characters of the content and take it as the title. More sophisticated logic could be applied, too.

No need to implement continuous tracking of the content to update the title, it seems to be over-engineering to me.

Remember, when I added title field in #19. We discussed that instead of extracting title from content, we should provide default title and allow user to change it if they decide. And we have that implementation of the title now. What remains is the description field and to fix the saving logic. User should be able to save title only or description only or both whenever they are edited

@tuancoltech
Copy link
Collaborator

This issue is mostly about logic of the UI. When a user creates a note, we wait until we have 20+ characters of the content and take it as the title. More sophisticated logic could be applied, too.
No need to implement continuous tracking of the content to update the title, it seems to be over-engineering to me.

Remember, when I added title field in #19. We discussed that instead of extracting title from content, we should provide default title and allow user to change it if they decide. And we have that implementation of the title now. What remains is the description field and to fix the saving logic. User should be able to save title only or description only or both whenever they are edited

@kirillt What's your thought on this?
What should be the logic for the title now?

Also, I'd like to make it more clear for below point:

User should be able to create a description, too. But it should be hidden by default.

-> This means we should provide user with a description field when creating a new note, but hide it from the note list UI?

@kirillt
Copy link
Member Author

kirillt commented Dec 19, 2023

@tuancoltech the description field should be empty by default, UI should have an input for filling it. We could hide the description inpit with chevron or something else.

The automatic title is an advanced version of plain default value (right now some text + date).

@tuancoltech
Copy link
Collaborator

@tuancoltech the description field should be empty by default, UI should have an input for filling it. We could hide the description inpit with chevron or something else.

The automatic title is an advanced version of plain default value (right now some text + date).

@kirillt So, regarding note title, every newly created note will have a default title as text + date at the moment.
I'm not sure in which case it should reflect the first 20 characters of the note content then?

@kirillt
Copy link
Member Author

kirillt commented Dec 20, 2023

I'm not sure in which case it should reflect the first 20 characters of the note content then?

As I see it, before the user typed 20 characters we have the default title. The default title is replaced by first 20 characters when the note becomes long enough.

@kirillt
Copy link
Member Author

kirillt commented Dec 20, 2023

@tuancoltech Sorry for the change. After thinking through the flow I suggested before, I've realized we can throw "default title" away completely and implement simple "automatic title".

Automatic title

  • If user has explicitly set the title, we store it in the properties and display it always.
  • If user hasn't set the title, we store empty title in the properties and display first 20 characters of the content. Or the whole note if it's shorter than 20 characters.

Tangential thoughts
We don't care about empty notes because we don't save them. We don't save duplicate notes, too. So we don't need to distinguish duplicates, so we can always take the content as the title, if it's short. We can have similar titles for long notes. I think, we can just display dates and/or timestamps next to note titles, in the notes list. We allow duplicate titles.

@tuancoltech
Copy link
Collaborator

tuancoltech commented Dec 20, 2023

@tuancoltech Sorry for the change. After thinking through the flow I suggested before, I've realized we can throw "default title" away completely and implement simple "automatic title".

Automatic title

  • If user has explicitly set the title, we store it in the properties and display it always.
  • If user hasn't set the title, we store empty title in the properties and display first 20 characters of the content. Or the whole note if it's shorter than 20 characters.

Tangential thoughts We don't care about empty notes because we don't save them. We don't save duplicate notes, too. So we don't need to distinguish duplicates, so we can always take the content as the title, if it's short. We can have similar titles for long notes. I think, we can just display dates and/or timestamps next to note titles, in the notes list. We allow duplicate titles.

@kirillt Thanks for making it clear. I'll implement it base on this idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

3 participants