Commit Graph

20 Commits

Author SHA1 Message Date
Igor Solomennikov
6a7d6c0fae
Switify some code related to ConversationInputToolbar.
* Remove "@objc" attribution in places related to ConversationInputToolbar where that is no longer necessary.
* Swiftify LinkPreviewState protocol.
* Convert ConversationScrollButton to Swift.
2022-11-07 16:32:59 -08:00
Igor Solomennikov
9000a5cbb9
Add support for appropriate fonts for different scripts in Text Story composer / viewer. 2022-11-01 16:16:12 -07:00
Igor Solomennikov
550f9b0a8a
Fix link preview not expanding to full-size in some cases. 2022-10-24 16:10:49 -07:00
Igor Solomennikov
3235eb6618
Render condensed text style (AA) in all caps in text story composer.
Preserve case-sensitive user input and make UITextView display ALLCAPS if
AA style is selected.
2022-10-24 13:33:48 -07:00
Igor Solomennikov
6005d55c11
Expand link preview vertically in composer if user deletes text.
In text story composer, link preview might be collapsed to "compact" layout 
after user enough text so that there's no more vertical room for both text 
and link preview.

This change improves composer behavior to expand link preview back to 
"regular" layout if user deletes some or all text and there's now room for both.
2022-10-20 17:23:11 -07:00
Harry
87db4ab0aa
Better multisend of text stories
* Shuffle code around, adding UnsentTextAttachment

* Replace usages of TextAttachment with UnsentTextAttachment where applicable, creating an actual TextAttachment (and associated OWSlinkPreview image TSAttachment, if applicable) only per-recipient

* Only upload one text story link preview image attachment and propagate it to the individual TSAttachments created for each destination

* update comments so I don't lose my mind the next time I read this code

* Dedupe text stories sent to the same person via multiple private threads

* fix non-compiling tests

* pr feedback
2022-10-20 11:04:25 -07:00
Harry
dc15f61a90
Fix text story link thumbnail blinking
* dont reload story thumbnails if the attachment hasn't changed

* Cache text attachment link preview images
2022-10-19 15:39:38 -07:00
Evan Hahn
370ff654e7
Change license to AGPL
Change license to AGPL

This commit:

- Updates the `LICENSE` file

- Start every file with something like:

      // Copyright YEAR_FIRST_PUBLISHED Signal Messenger, LLC
      // SPDX-License-Identifier: AGPL-3.0-only

---

First, I removed existing license headers with this Ruby 3.1.2 script:

    require 'set'

    EXTENSIONS_TO_CHECK = Set['.h', '.hpp', '.cpp', '.m', '.mm', '.pch', '.swift']

    same = 0
    different = 0

    all_files = `git ls-files`.lines.map { |line| line.strip }
    all_files.each do |relative_path|
      if relative_path == 'Pods'
        next
      end

      unless EXTENSIONS_TO_CHECK.include? File.extname(relative_path)
        next
      end

      path = File.expand_path(relative_path)

      contents = File.read(path)
      new_contents = contents.sub(/\/\/\n\/\/  Copyright .*\n\/\/\n\n/, '')

      if contents == new_contents
        same += 1
      else
        different += 1
      end

      File.write(path, new_contents)
    end

    puts "updated #{different} file(s), left #{same} untouched"

I'm sure this script could be improved, but it worked well enough.

Then, I created `Scripts/lint/lint-license-headers` and ran it to auto-
fix a lot of files. This changed the mode of some files, but I think
that's actually desirable. For example,
`SignalServiceKit/src/Util/AppContext.m` previously had a mode of
`0755/-rwxr-xr-x`, and it's now `0644/-rw-r--r--`.

Then I fixed some stragglers and updated the precommit script.

See [a similar change in the Desktop app][0].

[0]: 8bfaf598af
2022-10-13 08:25:37 -05:00
Igor Solomennikov
f8a0066284
Better layout for text story composer on iPad.
• Constrain text styling toolbar width to the width of the story card.

• Align Add Link and Background buttons with the leading edge of text story card.
2022-10-11 22:32:13 -07:00
Igor Solomennikov
f01f4d4a7c Fix no rounded corners for gradient backgrounds in text story composer. 2022-10-06 22:00:38 -07:00
Igor Solomennikov
e926b26f5d
Text stories UI improvements
* Allow to force "compact" style for a link preview view.

Link previews should be displayed in "compact" mode when there's a significant
amount of text.

* RoundMediaButton should never be allowed to be made smaller than its desired size.

* Improved layout for text stories: both composer and viewer.

There is now a shared UI layout logic between editor and viewer, editor being
a subclass of viewer.

New behavior for composer:
 • text view will grow in height as much as possible and becomes scollable
   when max height is reached.
 • link preview starts in "regular" layout (image above the text) and then
   is updated to "compact" layout (image on the left, text on the right)
   as text view grows.

New behavior for viewer:
 • updated font sizes for match spec.
 • for extra tall stories text label is scaled down to fit.

* Fix bug where Proceed button would stay disabled after composing a text story.

* Fix two UX issues reported in PR review.
2022-10-05 12:46:03 -07:00
Igor Solomennikov
28faf6e0ae
Use "compact" layout for link preview panel when no image. 2022-09-30 12:27:33 -07:00
Igor Solomennikov
7d862d87ae
Fix link preview image size when there's 5 lines of text
Let thumbnail grow vertically to match text height.
2022-09-27 06:17:32 -05:00
Igor Solomennikov
19cf2d07f6 Change font weight for 'regular' text style in text stories from Bold to Medium. 2022-09-21 11:33:27 -07:00
Igor Solomennikov
5c98fcfeb7
Updated look for link previews in text stories. 2022-09-20 12:57:22 -07:00
Igor Solomennikov
607fdc810e
Add support for multi-point gradient background in text stories.
Also update palette of background colors and gradients to latest spec.
2022-09-14 08:26:23 -07:00
Igor Solomennikov
a74c7e0885
Modify link preview panel UI used in stories viewer to allow its re-use.
• Extract the code into a new TextAttachmentView.LinkPreviewView class.
• Modify the code to accept wider variety of link preview data.
2022-08-31 16:53:38 -07:00
Igor Solomennikov
91fee94b4c
Improve GradientView slightly and re-use it in TextAttachmentView. 2022-08-23 18:19:22 -07:00
Nora Trapp
1443eef293 Animate presentation and dismissal of stories with interactive dismissal 2022-04-21 11:00:12 -07:00
Nora Trapp
27e03b6a70 Render 1:1 story replies 2022-04-15 19:28:14 -07:00