74 Commits

Author SHA1 Message Date
Alex Vandiver
2491dc47e8 i18n: Swap three docs for ellipsis. 2025-07-30 13:45:53 +00:00
Karl Stolley
062b83bfec compose: Rename classes, CSS vars to reflect attention level. 2025-06-20 15:54:59 -07:00
Karl Stolley
06696bc206 compose: Audition new-topic button in topic box. 2025-06-19 17:21:20 -07:00
Karl Stolley
966c8451df compose: Add functions to mute/unmute recipient row. 2025-06-19 17:21:20 -07:00
Karl Stolley
d7102f7443 compose: Remove unused .close class.
This is probably a vestige of Bootstrap, but there are
no meaningful styles or behaviors attached to this class.
2025-04-30 10:26:20 -07:00
Prakhar Pratyush
280fd40892 inline_topic_edit: Improve placeholder when topic is not mandatory.
Earlier, we used to show "general chat" as the placeholder.

This commit adds support to show "Enter a topic (skip for general
chat)" as the placeholder when topic is not mandatory in the
inline topic edit input box.

We show "general chat" (as we show in compose topic input box)
when inline topic edit input box is not focused and topic="".

Fixes part of #33846.
2025-03-13 11:30:58 -07:00
Prakhar Pratyush
087abb4314 composebox: Show 'Enter a topic (skip for general chat)' placeholder.
Use a more instructive placeholder instead of "Topic" when
topic is not mandatory in a realm.

Updated placeholder:
'Enter a topic (skip for general chat)'.
2025-02-26 14:03:24 -08:00
Karl Stolley
8feaa5e6e8 compose: Initialize scrolling buttons only when needed. 2025-01-14 15:52:02 -08:00
Karl Stolley
0d0aaa8586 compose: Introduce scrolling buttons in gridded layout. 2025-01-14 15:52:02 -08:00
opmkumar
88727862b4 compose: Refactor functions for handling max length limits.
Refactors `check_overflow_text` and `validate_message_length` functions.
This commit ensures that there won't be any change in the existing UI
of the compose box with the refactoring of the above functions.
2024-12-04 11:44:51 -08:00
opmkumar
0055633002 css: Add general class names for improved extensibility.
Adds general class names in `compose.hbs` so that these elements can be
more easily expanded for use in the edit message UI as well. These
classes will be used in the `check_overflow_text` function of
`compose_validate.ts`, allowing this function to handle both the edit
message UI and compose box UI.
2024-12-04 11:44:51 -08:00
Karl Stolley
f4554613a0 compose: Delegate max-length tooltip to body. 2024-11-18 12:44:24 -08:00
Anders Kaseorg
e172c717f7 webpack: Enable explicitPartialContext for handlebars-loader.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-15 20:41:59 -08:00
Karl Stolley
d73044ee57 compose: Decouple compose buttons from button classes.
In the 2024 redesigned button configurations, the compose buttons
become outliers. This retains their previous style inherited from
.button, allowing that base component class to move forward.
2024-09-19 16:16:11 -07:00
Karl Stolley
d91321a2c4 cleanup: Remove singleton .new-style class refs. 2024-09-11 14:22:45 -07:00
Shubham Padia
a764e80a1b css: Use classname for scroll-to-bottom icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia
aa74de182e compose: Remove unnecessary .small class for compose buttons.
For buttons in the compose box using `.small`, all properties except
min-width were already being overriden in compose.css. So we added
`min-width: inherit` to compose.css and remove the `small` class.

Preparatory commit for #30895.
2024-07-15 10:39:31 -07:00
N-Shar-ma
9bc1eb4bb9 compose: Allow 3-way compose box resizing with new fixed expanded state.
Apart from the normal (collapsed) and full screen sizes, a new expanded
state with the same size as the maximum a normal compose box can stretch
to when full (40% of the screen height) is now available. Now a user can
expand the compose box without it covering the full screen with a click.
The vertical resize icon in the bottom right corner of the compose box
is rendered useless so has been removed.

All three states can be cycled through by clicking the compose resize
button in the order: collapsed -> 40% of the screen -> full screen. When
a message naturally causes the compose box in its normal state to expand
up to 40% of the screen, clicking the resize button will take it to full
screen state.

Fixes: #29966.
2024-06-26 16:36:52 -07:00
N-Shar-ma
878d02cf5c compose: Redesign control buttons row and textbox to look like 1 unit.
The row of buttons is placed using CSS grid template areas so that
visually it is now inside the bottom edge of the textbox. The color of
the buttons row and individual buttons is changed to match the color of
the textbox. All textbox border / box shadow properties are now applied
to its parent instead which is extended under the buttons' row, so that
its border snuggly fits around the buttons row too.

Notable side effects:
- In dark mode the textbox in focused state now has a light border which
does not match the recipient input's current border which doesn't change
when focused. Likely, the recipient input should be updated to match the
textbox's border color.
- The dividers in the formatting buttons row are not vertically centered
now. This should be figured out soon.

Fixes: #28702.
2024-06-21 17:29:56 -07:00
Shubham Padia
43eebbf9c6 scroll: Set tabIndex to -1 for simplebar content wrapper.
Fixes #30403.
Having tabIndex set to 0 led to keyboard focus being put on
a scrollbar container, which led to users having to tab twice
to skip a container.
This commit also removes instances of tabIndex being set to
-1 programatically for certain cases, since it is -1 by default now.
This commit also removes `outline: none` for simplebar since
that property is not needed anymore because the wrapper is
not focusable anymore.
2024-06-20 10:25:51 -07:00
N-Shar-ma
906a9ca8f2 compose: Rework alignment of upper elements, and redesign close icon.
We now right align recipient input (even at very narrow widths) and
banners to the textbox, and move the close button to the absolute top
right corner of the compose box, updating the icon to be slimmer, bigger
and purplish, and adding a background highlight on hover.

This involved refactoring the send control area width into a responsive
css variable, and simplifying the html structure of the compose box.

Fixes: #28792.
2024-06-18 15:51:51 -07:00
N-Shar-ma
50fcc740bc compose: Fix bug causing layout shift on expanding compose box.
The messagebox-wrapper div is removed, and it's only style `flex: 1` is
applied to the messagebox div. The `height: 100%` and `margin-top: 5px`
styles on the messagebox div were earlier causing it to move 5px down,
outside the messagebox-wrapper div, when the compose box was expanded.
2024-06-14 10:18:08 -07:00
N-Shar-ma
ac3b5b3b04 compose: Redesign and relocate compose expand / collapse button.
The compose expand / collapse button is moved from the top right of the
compose area to the top right corner inside the compose textarea /
preview.

The textarea / preview and the button area shares the same grid parent.
25px extra padding is added to and margin is subtracted from the right
of the element so the button is visually inside it. It appears only on
hovering the compose area, and uses a new custom icon.

Fixes: #28791.
2024-06-11 14:13:10 -07:00
N-Shar-ma
e959a392c9 compose: Make conversation arrow double as a go-to-conversation button.
The chevron arrow icon before the topic / dm user field now also acts as
a go to conversation button. Whenever the functionality is available,
the plain icon changes to look and behave like a button. The old go to
conversation button on the right of the field is removed.

Fixes: #28697.
2024-06-05 09:26:01 -07:00
N-Shar-ma
1121d317c2 compose: Restructure HTML for common compose textarea/preview parent.
Earlier, the compose textarea and the preview (container) occupied the
same grid area, 1 at a time. Now, they are both children of a common div
which is assigned the same grid area. This allows adding more elements
to the same grid area in the future.

This is purely a code change and should have no visible effects.

This is a prep commit for relocating the compose expand / collapse
buttons to the top right inside corner of the textarea / preview.
2024-05-13 12:11:29 -07:00
N-Shar-ma
1ba3cda229 compose: Refactor recipient area to use grid layout instead of flexbox.
This is a prep commit for moving the narrow to compose recipients button
before the input, and also aids in the overall compose area redesign.
2024-05-02 14:28:04 -07:00
N-Shar-ma
bfbf4f6f68 compose: Redesign limit indicator to show remaining characters count.
Additionally, the text colors have been updated for both light and dark
themes, it starts showing when 900 or less characters are left, as 999
was too soon, and has a tooltip to show the maximum characters limit.

Fixes: #28706.
2024-04-30 14:16:10 -07:00
Kenneth Rodrigues
110ca73545 compose_tooltips: Improve tooltip logic for compose_reply_button.
Change compose_reply_button tooltip logic to show the correct tooltip.
Earlier in organizations where DMs were disabled, a stale tooltip was
being displayed.

Earlier if the user hovered over the compose_reply_button when it was
disabled and switched to a stream in which it was enabled before waiting
for the tooltip delay, the next time the user hovers over the
compose_reply_button the stale disabled tooltip is displayed instead of
the enabled one.

This is fixed by checking if the compose_reply_button is enabled on the
fly while rendering the tooltip via instance.setContent().

Fixes #29238.
2024-04-24 17:29:16 -07:00
N-Shar-ma
f800d4404e compose: Redesign the arrow between stream and topic.
The icon is now bigger, slimmer in stroke width, lighter in color, and
has less horizontal spacing around it.

Fixes: part of #28792.
2024-03-25 16:12:32 -07:00
Mahhheshh
1c48ed0a1c stream picker: Remove stream colorblock.
To achive this the `stream_header_colorblock` div was removed from
`dropdown_widget_with_stream_colorblock.hbs` template. this change made
the file name irelevenet so it was necessary to rename the file to
`dropdown_widget_wrapper.hbs`. After removing the html strcuture for
colorblock from templates the css for colorblock was also removed.
followed by the javascript which was used to add colorblock to the
stream picker. After removing javascript tests were updated.
Fixes: #28796.
2024-03-15 11:11:04 -07:00
N-Shar-ma
f4d58f1ba6 compose: Show counter inside Drafts button for the current recipient.
Now we show the number of drafts that are addressed to the current
recipient selected in the compose box, if any, in the Drafts button
within parentheses (whether it is next to the Send button, or in the
Send options popover), and explain that it is the number of drafts for
this conversation in the tooltip.

Fixes: #28696.
2024-03-13 16:53:45 -07:00
Sayam Samal
a0411e32b6 compose_tooltips: Fix tooltips for disabled conversation button.
In the situation where the DMs are disabled in an organization, we
disable the new conversation button. But due to this, the tooltip
hinting towards the same, was also being disabled because it was
attached to a disabled element which does not fire any events.

This commit fixes this bug, by wrapping the new conversation button
inside a div, and attaching the tooltip to this wrapper instead.
2024-03-05 10:55:20 -08:00
Karl Stolley
3201c7dfb5 compose_box: Extend use of send-control-button.
This uses `.send-control-button` to handle Tippies on those
elements (currently vdots and Drafts), and removes a confusing
compose-formatting class.
2023-11-14 09:21:11 -08:00
Karl Stolley
5bedbb14b4 compose_box: Rename message-control-button to send-control-button. 2023-11-14 09:21:11 -08:00
Karl Stolley
d92a1e7ca8 compose_box: Update vdots tooltip to 'Send options'. 2023-11-13 12:45:13 -08:00
Karl Stolley
609106e2d0 compose_box: Implement redesigned vdots-button styles. 2023-11-13 12:45:13 -08:00
Karl Stolley
bf0e806fed compose_box: Implement redesigned send-button styles. 2023-11-13 12:45:13 -08:00
Karl Stolley
a3c1399924 compose_box: Handle compose and preview expansion. 2023-11-13 12:45:13 -08:00
Karl Stolley
9f00b513f7 compose_box: Improve structures around compose buttons. 2023-11-13 12:45:13 -08:00
Karl Stolley
e608a389af compose_box: Improve structures around send controls. 2023-11-13 12:45:13 -08:00
Karl Stolley
b4b71880e1 compose_box: Prepare redesign send and draft structures. 2023-11-13 12:45:13 -08:00
Karl Stolley
f98570704d compose: Present Start new topic button adjacent the reply button.
Fixes: #24889.

Co-Authored-By: Daniil Fadeev <shameondev@gmail.com>
2023-10-10 17:37:03 -07:00
Karl Stolley
654469b29f compose: Make DM identifiers align with new conversations. 2023-10-10 17:37:03 -07:00
Karl Stolley
c73de34f32 compose: Introduce 'Start new conversation' button. 2023-10-10 17:37:03 -07:00
Daniil Fadeev
9303339810 compose: Remove the unused span wrapper for buttons. 2023-10-10 17:37:03 -07:00
Karl Stolley
5b82a62b26 compose: Add button to clear topic box.
Fixes part of #24889.

Co-Authored-By: Daniil Fadeev <shameondev@gmail.com>
2023-10-10 17:37:03 -07:00
Karl Stolley
89ce2c112c vdots: Place new more-vertical icon in compose box. 2023-09-14 17:13:58 -07:00
Aman Agrawal
6efcb7a349 dropdown_widget: Refactor to use Class. 2023-07-27 14:10:08 -07:00
Aman Agrawal
ecc1433d02 compose_recipient: Improve post recipient selection behaviour.
This moves selection of the correct input box / textarea to
a `on_hidden_callback` of dropdown widget, which also allows us
to just simplify `on_compose_select_recipient_update` to only
call `switch_message_type` when necessary so that it doesn't
interfere with setting focus.
2023-05-29 08:59:18 -07:00
Karl Stolley
42e0d72b67 compose_box: Maintain consistent dropdown height.
This commit keeps the height of the dropdown consistent, even when
it's adjacent a multiline collection of pills in a group DM.

It also keeps the righthand buttons and narrows top-aligned, too.

Additional markup and CSS ensures that the < marker always stays
vertically centered with respect to the dropdown.
2023-05-25 17:19:29 -07:00