Skip to content

feat: text blocks #10276

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

feat: text blocks #10276

wants to merge 8 commits into from

Conversation

hamza221
Copy link
Contributor

@hamza221 hamza221 commented Oct 17, 2024

ref #10113

  • Unit tests
  • use route resources

Testing:

  • Snippets CRUD operations are in Account settings
  • Inserting a snippet inside the composer is done with the '!' trigger
  • use the text block modal in composer '...' actions button next to send button

@hamza221 hamza221 linked an issue Oct 21, 2024 that may be closed by this pull request
4 tasks
@hamza221 hamza221 force-pushed the feat/snippets branch 2 times, most recently from f2dd62e to 11fc522 Compare October 31, 2024 18:00
@hamza221
Copy link
Contributor Author

Feature finally functioning the only thing missing is sharing fe and ui needs polishing

@hamza221
Copy link
Contributor Author

hamza221 commented Nov 6, 2024

  • Html/preview support
  • fix share +UI

@hamza221 hamza221 marked this pull request as ready for review November 8, 2024 13:42
@hamza221 hamza221 self-assigned this Nov 8, 2024
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add unit tests for the php part at least

@hamza221 hamza221 marked this pull request as draft December 10, 2024 09:56
@hamza221 hamza221 marked this pull request as ready for review December 19, 2024 14:24
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 Very clean code

@hamza221 hamza221 force-pushed the feat/snippets branch 2 times, most recently from 18fb5d3 to 89dd240 Compare January 9, 2025 13:30
@ChristophWurst
Copy link
Member

Psalm wants to have a word

@hamza221
Copy link
Contributor Author

hamza221 commented Jan 9, 2025

🤞

@hamza221
Copy link
Contributor Author

hamza221 commented Jan 9, 2025

don't merge yet, I wanna give it a last test, after the psalm changes

@hamza221
Copy link
Contributor Author

hamza221 commented Jan 9, 2025

version bump was missing because of rebase

@hamza221 hamza221 enabled auto-merge January 9, 2025 13:51
@hamza221 hamza221 disabled auto-merge January 9, 2025 14:10
@hamza221 hamza221 force-pushed the feat/snippets branch 3 times, most recently from 993f43b to a99dba5 Compare March 18, 2025 11:51
Signed-off-by: Hamza Mahjoubi <[email protected]>
@hamza221 hamza221 requested a review from nimishavijay March 27, 2025 09:57
@hamza221 hamza221 changed the title feat: mail snippets (WIP) feat: mail snippets Mar 27, 2025
@hamza221
Copy link
Contributor Author

hamza221 commented Mar 27, 2025

Copying Over @nimishavijay 's comment

  • Snippets --> Text blocks
  • Move the section in the settings to below General

Inside setting dialog

  • Snippets heading --> list of snippets --> Create new snippet button
  • For each snippet use NcListItem component with title in one line and content in subline and 3 dot menu
  • Add shared icon to the left of 3 dot menu
  • In 3 dot menu delete at the end
  • In 3 dot menu For edit use pencil icon
  • Nice-to-have: show share icon if it's shared with other people

image

  • new snippet dialog and edit snippet dialog --> add border in content so that it looks like a text field
    • Buttons in new and edit dialog
    • "Ok" --> "Save text block"
    • Cancel icon --> x symbol
    • Cancel button tertiary
    • width of the buttons should be fit-content
    • all buttons right aligned
  • Edit dialog
    • width same as new snippet dialog
    • remove "Content" heading
    • "Shares" --> h3
    • Add placeholder in dropdown "Search for users or groups"
    • Instead of UserBubble component for added users use NcListItem (similar to calendar sharing or files sharing) with an x to remove

Incoming shared text blocks

  • Allow opening and viewing full text block
  • Hide section if empty

While inserting in composer

  • character?
  • in 3 dot menu have "Insert text block" item after smart picker item
  • Open modal with list of text blocks and search bar which filters the results similar to Talk create conversation add participants modal

Follow up

  • combine with smart picker

@hamza221 hamza221 marked this pull request as draft March 27, 2025 14:34
hamza221 added 6 commits April 1, 2025 18:34
Signed-off-by: Hamza Mahjoubi <[email protected]>
Signed-off-by: Hamza Mahjoubi <[email protected]>
Signed-off-by: Hamza Mahjoubi <[email protected]>
Signed-off-by: Hamza Mahjoubi <[email protected]>
Signed-off-by: Hamza Mahjoubi <[email protected]>
Signed-off-by: Hamza Mahjoubi <[email protected]>
@hamza221 hamza221 marked this pull request as ready for review April 7, 2025 12:14
@hamza221 hamza221 changed the title (WIP) feat: mail snippets (WIP) feat: text blocks Apr 7, 2025
@hamza221 hamza221 changed the title (WIP) feat: text blocks feat: text blocks Apr 7, 2025
@hamza221 hamza221 requested a review from ChristophWurst April 7, 2025 12:14
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Structure looks sane

Given the 2.4k diff I wonder if we should get a smaller version without sharing in first. With unit tests we'll probably go above 3k even.

$table->addColumn('preview', Types::TEXT, [
'notnull' => true,
]);
$table->setPrimaryKey(['id']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is only a primary key, no other indexes. Look at the queries you send and add the missing index(es)

'notnull' => true,
'length' => 64,
]);
$table->setPrimaryKey(['id']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is only a primary key, no other indexes. Look at the queries you send and add the missing index(es)

'notnull' => true,
'length' => 64,
]);
$table->addColumn('text_block_id', Types::STRING, [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is is a foreign key but there is no foreign key constraint. you will have dangling pointers when the blocks are deleted. add the FK and cascade deletion.

:bus="bus" />
<template v-if="!shared">
<h3>
{{ t('mail','Shares') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{ t('mail','Shares') }}
{{ t('mail', 'Shares') }}

Signed-off-by: Hamza Mahjoubi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Text blocks
3 participants