Skip to content

Commit 61ec15d

Browse files
committed
Merge remote-tracking branch 'parent/main' into upstream-20260304
2 parents d8914dd + eb848d0 commit 61ec15d

151 files changed

Lines changed: 3375 additions & 974 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ services:
5656
- internal_network
5757

5858
es:
59-
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
59+
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.29
6060
restart: unless-stopped
6161
environment:
6262
ES_JAVA_OPTS: -Xms512m -Xmx512m

.github/workflows/test-ruby.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,10 @@ jobs:
357357
- '3.3'
358358
- '.ruby-version'
359359
search-image:
360-
- docker.elastic.co/elasticsearch/elasticsearch:7.17.13
360+
- docker.elastic.co/elasticsearch/elasticsearch:7.17.29
361361
include:
362362
- ruby-version: '.ruby-version'
363-
search-image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
363+
search-image: docker.elastic.co/elasticsearch/elasticsearch:8.19.2
364364
- ruby-version: '.ruby-version'
365365
search-image: opensearchproject/opensearch:2
366366

Gemfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ group :test do
129129
# Adds RSpec Error/Warning annotations to GitHub PRs on the Files tab
130130
gem 'rspec-github', '~> 3.0', require: false
131131

132-
# RSpec helpers for email specs
133-
gem 'email_spec'
134-
135132
# Extra RSpec extension methods and helpers for sidekiq
136133
gem 'rspec-sidekiq', '~> 5.0'
137134

Gemfile.lock

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ GEM
9999
ast (2.4.3)
100100
attr_required (1.0.2)
101101
aws-eventstream (1.4.0)
102-
aws-partitions (1.1220.0)
103-
aws-sdk-core (3.242.0)
102+
aws-partitions (1.1222.0)
103+
aws-sdk-core (3.243.0)
104104
aws-eventstream (~> 1, >= 1.3.0)
105105
aws-partitions (~> 1, >= 1.992.0)
106106
aws-sigv4 (~> 1.9)
@@ -224,10 +224,6 @@ GEM
224224
base64
225225
faraday (>= 1, < 3)
226226
multi_json
227-
email_spec (2.3.0)
228-
htmlentities (~> 4.3.3)
229-
launchy (>= 2.1, < 4.0)
230-
mail (~> 2.7)
231227
email_validator (2.2.4)
232228
activemodel
233229
erb (6.0.2)
@@ -294,7 +290,7 @@ GEM
294290
activesupport (>= 5.1)
295291
haml (>= 4.0.6)
296292
railties (>= 5.1)
297-
haml_lint (0.71.0)
293+
haml_lint (0.72.0)
298294
haml (>= 5.0)
299295
parallel (~> 1.10)
300296
rainbow
@@ -311,7 +307,7 @@ GEM
311307
hiredis-client (0.26.4)
312308
redis-client (= 0.26.4)
313309
hkdf (0.3.0)
314-
htmlentities (4.3.4)
310+
htmlentities (4.4.2)
315311
http (5.3.1)
316312
addressable (~> 2.8)
317313
http-cookie (~> 1.0)
@@ -414,12 +410,12 @@ GEM
414410
rexml
415411
link_header (0.0.8)
416412
lint_roller (1.1.0)
417-
linzer (0.7.7)
418-
cgi (~> 0.4.2)
413+
linzer (0.7.8)
414+
cgi (>= 0.4.2, < 0.6.0)
419415
forwardable (~> 1.3, >= 1.3.3)
420416
logger (~> 1.7, >= 1.7.0)
421-
net-http (~> 0.6.0)
422-
openssl (~> 3.0, >= 3.0.0)
417+
net-http (>= 0.6, < 0.10)
418+
openssl (>= 3, < 5)
423419
rack (>= 2.2, < 4.0)
424420
starry (~> 0.2)
425421
stringio (~> 3.1, >= 3.1.2)
@@ -628,7 +624,7 @@ GEM
628624
psych (5.3.1)
629625
date
630626
stringio
631-
public_suffix (7.0.2)
627+
public_suffix (7.0.5)
632628
puma (7.2.0)
633629
nio4r (~> 2.0)
634630
pundit (2.5.2)
@@ -892,7 +888,7 @@ GEM
892888
unf (~> 0.1.0)
893889
tzinfo (2.0.6)
894890
concurrent-ruby (~> 1.0)
895-
tzinfo-data (1.2025.3)
891+
tzinfo-data (1.2026.1)
896892
tzinfo (>= 1.0.0)
897893
unf (0.1.4)
898894
unf_ext
@@ -977,7 +973,6 @@ DEPENDENCIES
977973
discard (~> 1.2)
978974
doorkeeper (~> 5.6)
979975
dotenv
980-
email_spec
981976
fabrication
982977
faker (~> 3.2)
983978
faraday-httpclient

app/controllers/accounts_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def show
1818
respond_to do |format|
1919
format.html do
2020
expires_in(15.seconds, public: true, stale_while_revalidate: 30.seconds, stale_if_error: 1.hour) unless user_signed_in?
21+
22+
redirect_to short_account_path(@account) if account_id_param.present? && username_param.blank?
2123
end
2224

2325
format.rss do

app/controllers/statuses_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def show
2626
respond_to do |format|
2727
format.html do
2828
expires_in 10.seconds, public: true if current_account.nil?
29+
30+
redirect_to short_account_status_path(@account, @status) if account_id_param.present? && username_param.blank?
2931
end
3032

3133
format.json do

app/javascript/mastodon/components/account/account.stories.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ const meta = {
5050
type: 'boolean',
5151
description: 'Whether to display the account menu or not',
5252
},
53+
withBorder: {
54+
type: 'boolean',
55+
description: 'Whether to display the bottom border or not',
56+
},
5357
},
5458
args: {
5559
name: 'Test User',
@@ -60,6 +64,7 @@ const meta = {
6064
defaultAction: 'mute',
6165
withBio: false,
6266
withMenu: true,
67+
withBorder: true,
6368
},
6469
parameters: {
6570
state: {
@@ -103,6 +108,12 @@ export const NoMenu: Story = {
103108
},
104109
};
105110

111+
export const NoBorder: Story = {
112+
args: {
113+
withBorder: false,
114+
},
115+
};
116+
106117
export const Blocked: Story = {
107118
args: {
108119
defaultAction: 'block',

app/javascript/mastodon/components/account/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ interface AccountProps {
7777
hideButtons?: boolean;
7878
childrenA?: ReactNode;
7979
withMenu?: boolean;
80+
withBorder?: boolean;
8081
extraAccountInfo?: React.ReactNode;
8182
children?: React.ReactNode;
8283
}
@@ -91,6 +92,7 @@ export const Account: React.FC<AccountProps> = ({
9192
hideButtons,
9293
childrenA,
9394
withMenu = true,
95+
withBorder = true,
9496
extraAccountInfo,
9597
children,
9698
}) => {
@@ -300,6 +302,7 @@ export const Account: React.FC<AccountProps> = ({
300302
<div
301303
className={classNames('account', {
302304
'account--minimal': minimal,
305+
'account--without-border': !withBorder,
303306
})}
304307
>
305308
<div
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import type { Meta, StoryObj } from '@storybook/react-vite';
2+
3+
import { CharacterCounter } from './index';
4+
5+
const meta = {
6+
component: CharacterCounter,
7+
title: 'Components/CharacterCounter',
8+
} satisfies Meta<typeof CharacterCounter>;
9+
10+
export default meta;
11+
12+
type Story = StoryObj<typeof meta>;
13+
14+
export const Required: Story = {
15+
args: {
16+
currentString: 'Hello, world!',
17+
maxLength: 100,
18+
},
19+
};
20+
21+
export const ExceedingLimit: Story = {
22+
args: {
23+
currentString: 'Hello, world!',
24+
maxLength: 10,
25+
},
26+
};
27+
28+
export const Recommended: Story = {
29+
args: {
30+
currentString: 'Hello, world!',
31+
maxLength: 10,
32+
recommended: true,
33+
},
34+
};
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { useMemo } from 'react';
2+
3+
import { FormattedMessage } from 'react-intl';
4+
5+
import classNames from 'classnames';
6+
7+
import { polymorphicForwardRef } from '@/types/polymorphic';
8+
9+
import classes from './styles.module.scss';
10+
11+
interface CharacterCounterProps {
12+
currentString: string;
13+
maxLength: number;
14+
recommended?: boolean;
15+
}
16+
17+
const segmenter = new Intl.Segmenter();
18+
19+
export const CharacterCounter = polymorphicForwardRef<
20+
'span',
21+
CharacterCounterProps
22+
>(
23+
(
24+
{
25+
currentString,
26+
maxLength,
27+
as: Component = 'span',
28+
recommended = false,
29+
...props
30+
},
31+
ref,
32+
) => {
33+
const currentLength = useMemo(
34+
() => [...segmenter.segment(currentString)].length,
35+
[currentString],
36+
);
37+
return (
38+
<Component
39+
{...props}
40+
ref={ref}
41+
className={classNames(
42+
classes.counter,
43+
currentLength > maxLength && !recommended && classes.counterError,
44+
)}
45+
>
46+
{recommended ? (
47+
<FormattedMessage
48+
id='character_counter.recommended'
49+
defaultMessage='{currentLength}/{maxLength} recommended characters'
50+
values={{ currentLength, maxLength }}
51+
/>
52+
) : (
53+
<FormattedMessage
54+
id='character_counter.required'
55+
defaultMessage='{currentLength}/{maxLength} characters'
56+
values={{ currentLength, maxLength }}
57+
/>
58+
)}
59+
</Component>
60+
);
61+
},
62+
);
63+
CharacterCounter.displayName = 'CharCounter';

0 commit comments

Comments
 (0)