Commit Graph

44 Commits

Author SHA1 Message Date
Elaine
3b1636e179
Fix stories links 2026-06-09 19:30:28 -04:00
Max Radermacher
13d5fe93dc
Run swiftformat . using v0.60.1 2026-03-26 17:10:38 -05:00
Sasha Weiss
d267ec8305
Run swiftformat . 2025-12-30 11:34:05 -08:00
Igor Solomennikov
f2ce8ecd5f
Remove UIFont.dynamicTypeBody2 - it's the same as subheadline. 2025-09-08 20:10:43 -05:00
Harry
e80785c72a
Fix link preview showing failed icon when downloading image 2025-04-14 14:32:38 -07:00
Harry
8df602b184
Render most undownloadable attachments 2025-01-31 14:43:48 -08:00
Harry
2af0bb31dc
Remove TSResource/Stream/Pointer/Thumbnail, use v2 types directly instead 2024-12-04 13:29:06 -08:00
Marissa Le Coz
0621ab8691
Randomize call link icon colors 2024-10-15 13:12:24 -04:00
Marissa Le Coz
9b7902a829
Add preview support for call links in drafted messages 2024-10-01 15:19:49 -04:00
Ehren Kret
5ea36cd91b enable internal imports by default 2024-09-29 20:03:17 -05:00
Ehren Kret
13a1637608 migrate AppContext protoocl to swift 2024-05-08 07:37:37 -05:00
Harry
ca5bd9702a
Set UIView image on main thread 2024-05-06 12:07:11 -05:00
Harry
e8939fa928
Some final easy story TSAttachment bridging removals 2024-04-25 10:22:30 -07:00
Harry
ec181d09b8
TSAttachment->TSResource cleanups 2024-04-15 09:44:21 -07:00
Harry
a55476d667
Modernize LinkPreviewManager 2024-03-19 13:46:09 -07:00
Harry
c84c97268c
Add thumbnail image generation methods to TSResourceStream 2024-03-08 19:28:12 -06:00
Harry
53d1a6e441
Load text story link preview attachments at the same time we load image attachments 2024-02-14 16:49:01 -08:00
Harry
4713edf61c
Spoiler animations part 7: odds and ends 2023-07-17 09:17:27 -07:00
Harry
c9bd43c0ab
Spoiler animations part 6: story captions and text stories 2023-07-17 08:33:29 -07:00
Igor Solomennikov
52f0015dfe
New set of icons. 2023-06-22 17:38:01 -07:00
Harry
8aaafc70c6
Display styles in story captions 2023-05-11 15:08:49 -07:00
Harry
1fe5612cff
Support text formatting in text stories 2023-05-11 10:42:37 -07:00
Evan Hahn
14237a873f
NSLocalizedString -> OWSLocalizedString 2023-04-25 13:28:46 -05:00
Igor Solomennikov
6dd3d9a6f2
Convert all convenience methods in UIFont+OWS to Swift. 2023-04-18 17:14:51 -07:00
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