Skip to content

[hack days] ntp: +search #1736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ body[data-animate-background="true"] {
:global(.layout-centered) {
margin-inline: auto;
width: 100%;
max-width: calc(504 * var(--px-in-rem));
max-width: calc(var(--default-ntp-tube-width) * var(--px-in-rem));
}

:global(.vertical-space) {
Expand Down
11 changes: 11 additions & 0 deletions special-pages/pages/new-tab/app/entry-points/search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { h } from 'preact';
import { Centered } from '../components/Layout.js';
import { Search } from '../search/components/Search.js';

export function factory() {
return (
<Centered data-entry-point="search">
<Search />
</Centered>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useDocumentVisibility } from '../../../../../shared/components/Document
* @typedef {import('../../../types/new-tab.js').FavoritesOpenAction['target']} OpenTarget
*/
export const FavoritesMemo = memo(Favorites);
export const ROW_CAPACITY = 6;
export const ROW_CAPACITY = 8;
/**
* Note: These values MUST match exactly what's defined in the CSS.
*/
Expand Down Expand Up @@ -65,7 +65,7 @@ export function Favorites({ favorites, expansion, toggle, openContextMenu, openF

return (
<FavoritesThemeContext.Provider value={{ theme: main.value, animateItems }}>
<div class={styles.root} data-testid="FavoritesConfigured" data-background-kind={kind}>
<div class={styles.root} data-testid="FavoritesConfigured" data-background-kind={kind} style={{ viewTransitionName: 'favs' }}>
<VirtualizedGridRows
WIDGET_ID={WIDGET_ID}
favorites={favorites}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

.gridRow {
display: grid;
grid-template-columns: repeat(6, 1fr);
grid-template-columns: repeat(var(--default-favorites-count), 1fr);
align-items: start;
position: absolute;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
.draggable {
backdrop-filter: blur(48px);
background: var(--ntp-surface-background-color);
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.12), 0px 0px 3px 0px rgba(0, 0, 0, 0.16);
box-shadow: var(--ntp-surface-shadow);
transition: transform .2s;

&:hover {
Expand Down
3 changes: 3 additions & 0 deletions special-pages/pages/new-tab/app/mock-transport.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { customizerData, customizerMockTransport } from './customizer/mocks.js';
import { freemiumPIRDataExamples } from './freemium-pir-banner/mocks/freemiumPIRBanner.data.js';
import { activityMockTransport } from './activity/mocks/activity.mock-transport.js';
import { protectionsMockTransport } from './protections/mocks/protections.mock-transport.js';
import { searchMockTransport } from './search/mocks/search.mock-transport.js';

/**
* @typedef {import('../types/new-tab').Favorite} Favorite
Expand Down Expand Up @@ -106,6 +107,7 @@ export function mockTransport() {
customizer: customizerMockTransport(),
activity: activityMockTransport(),
protections: protectionsMockTransport(),
search: searchMockTransport(),
};

return new TestTransportConfig({
Expand Down Expand Up @@ -444,6 +446,7 @@ export function mockTransport() {
{ id: 'rmf' },
{ id: 'freemiumPIRBanner' },
{ id: 'nextSteps' },
{ id: 'search' },
{ id: 'favorites' },
];

Expand Down
1 change: 1 addition & 0 deletions special-pages/pages/new-tab/app/new-tab.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ children:
- ./next-steps/next-steps.md
- ./customizer/customizer.md
- ./protections/protections.md
- ./search/search.md
---

## Requests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function Protections({ expansion = 'expanded', children, blockedCountSign
}, [WIDGET_ID, TOGGLE_ID]);

return (
<div class={styles.root}>
<div class={styles.root} style={{ viewTransitionName: 'protections' }}>
<ProtectionsHeading
blockedCountSignal={blockedCountSignal}
onToggle={toggle}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
background: var(--ntp-surface-background-color);
backdrop-filter: blur(48px);
border: 1px solid var(--ntp-surface-border-color);
box-shadow: var(--ntp-surface-shadow);
padding: var(--sp-6);
border-radius: var(--border-radius-lg);
display: grid;
Expand Down
Loading
Loading