memos icon indicating copy to clipboard operation
memos copied to clipboard

chore: allow user to view memos in different modes

Open MehadND opened this issue 1 year ago • 5 comments

This PR addresses the issue around memos that have a lot of content/length.

Inspired by this issue

The PR offers a way for users to set a mode for their memos in preference settings.

The two options available to users are FULL and COMPACT.

Full - Displays all of memo and its content. Compact - Displays a fraction of memo and hides the rest.

In Compact mode, users are given option in dropdown menu to expand/shrink current memo.

See video for reference.

https://github.com/usememos/memos/assets/34424878/5adb8f09-7383-4716-b5ef-c5db3053c5c7

MehadND avatar Feb 04 '24 17:02 MehadND

@MehadND is attempting to deploy a commit to the memos Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Feb 04 '24 17:02 vercel[bot]

this is great .

What algorithm did you use to view in different modes?

Is this related to the core of the program ?

Basically I created a string variable in user settings. Most of the implementation was similar to the visibility setting.

Hopefully that answers your questions.

MehadND avatar Feb 05 '24 15:02 MehadND

Hey @boojack can you review this PR? and can you please let me know if it can be merged with the current code or would I have to pass the teats?

p.s. i tried fixing the lint errors but couldn't

MehadND avatar Feb 05 '24 17:02 MehadND

Hey @boojack can you review this PR? and can you please let me know if it can be merged with the current code or would I have to pass the teats?

p.s. i tried fixing the lint errors but couldn't

You're almost there.

You must run buf generate inside ./proto, or pnpm pnpm postinstall from ./web and commit the generated files. image

Here's a git patch after running buf generate in this PR. proto-2863.patch

After that, golangci-lint run will still show some warnings about unchecked-type-assertion, but they are not related to your code and it's safe to ignore.

lincolnthalles avatar Feb 05 '24 21:02 lincolnthalles

Hey @boojack can you review this PR? and can you please let me know if it can be merged with the current code or would I have to pass the teats?

p.s. i tried fixing the lint errors but couldn't

You're almost there.

You must run buf generate inside ./proto, or pnpm pnpm postinstall from ./web and commit the generated files.

image

Here's a git patch after running buf generate in this PR.

proto-2863.patch

After that, golangci-lint run will still show some warnings about unchecked-type-assertion, but they are not related to your code and it's safe to ignore.

Ah ok that really helps a lot, I thought generally I should ignore pushing .pb.go files. My bad should have researched and understood the whole codebase.

Thank you for helping.

MehadND avatar Feb 05 '24 22:02 MehadND