Add: #400 検索結果(投稿)にフィルター (#563)

This commit is contained in:
KMY(雪あすか) 2024-02-16 18:43:33 +09:00 committed by GitHub
parent 76b5d4f2c6
commit f1ce14e396
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 7 additions and 2 deletions

View file

@ -52,7 +52,7 @@ const renderHashtags = hashtags => hidePeek(hashtags).map(hashtag => (
)); ));
const renderStatuses = statuses => hidePeek(statuses).map(id => ( const renderStatuses = statuses => hidePeek(statuses).map(id => (
<Status key={id} id={id} /> <Status key={id} id={id} contextType='explore' />
)); ));
class Results extends PureComponent { class Results extends PureComponent {
@ -181,7 +181,7 @@ class Results extends PureComponent {
{statuses.size > 0 && ( {statuses.size > 0 && (
<SearchSection key='statuses' title={<><Icon id='quote-right' icon={FindInPageIcon} /><FormattedMessage id='search_results.statuses' defaultMessage='Posts' /></>} onClickMore={this.handleLoadMoreStatuses}> <SearchSection key='statuses' title={<><Icon id='quote-right' icon={FindInPageIcon} /><FormattedMessage id='search_results.statuses' defaultMessage='Posts' /></>} onClickMore={this.handleLoadMoreStatuses}>
{statuses.take(INITIAL_DISPLAY).map(id => <Status key={id} id={id} />)} {statuses.take(INITIAL_DISPLAY).map(id => <Status key={id} id={id} contextType='explore' />)}
</SearchSection> </SearchSection>
)} )}
</> </>

View file

@ -61,6 +61,7 @@ class Statuses extends PureComponent {
prepend={<DismissableBanner id='explore/statuses'><FormattedMessage id='dismissable_banner.explore_statuses' defaultMessage='These are posts from across the social web that are gaining traction today. Newer posts with more boosts and favorites are ranked higher.' /></DismissableBanner>} prepend={<DismissableBanner id='explore/statuses'><FormattedMessage id='dismissable_banner.explore_statuses' defaultMessage='These are posts from across the social web that are gaining traction today. Newer posts with more boosts and favorites are ranked higher.' /></DismissableBanner>}
alwaysPrepend alwaysPrepend
timelineId='explore' timelineId='explore'
contextType='explore'
statusIds={statusIds} statusIds={statusIds}
scrollKey='explore-statuses' scrollKey='explore-statuses'
hasMore={hasMore} hasMore={hasMore}

View file

@ -5,6 +5,7 @@ export const toServerSideType = (columnType: string) => {
case 'public': case 'public':
case 'thread': case 'thread':
case 'account': case 'account':
case 'explore':
return columnType; return columnType;
default: default:
if (columnType.includes('list:') || columnType.includes('antenna:')) { if (columnType.includes('list:') || columnType.includes('antenna:')) {

View file

@ -29,6 +29,7 @@ class CustomFilter < ApplicationRecord
public public
thread thread
account account
explore
).freeze ).freeze
include Expireable include Expireable

View file

@ -1434,6 +1434,7 @@ en:
filters: filters:
contexts: contexts:
account: Profiles account: Profiles
explore: Trends and search results
home: Home and lists home: Home and lists
notifications: Notifications notifications: Notifications
public: Public timelines public: Public timelines

View file

@ -1422,6 +1422,7 @@ ja:
filters: filters:
contexts: contexts:
account: プロフィール account: プロフィール
explore: トレンド・検索
home: ホームおよびリスト home: ホームおよびリスト
notifications: 通知 notifications: 通知
public: 公開タイムライン public: 公開タイムライン