Skip to content

feat/PIP#32

Open
FioriDeveloper wants to merge 6 commits into
mainfrom
feat/PIPv2
Open

feat/PIP#32
FioriDeveloper wants to merge 6 commits into
mainfrom
feat/PIPv2

Conversation

@FioriDeveloper

Copy link
Copy Markdown
Collaborator

Substitui a implementação antiga baseada em canvas/video pelo
Document Picture-in-Picture API, renderizando os componentes
React reais em uma janela flutuante nativa do sistema.

  • Adiciona PipProvider com togglePip, pipWindow e isPipActive
  • Renderiza telas de chamada no pipWindow via createPortal
  • Ativa PiP automaticamente ao iniciar ou aceitar chamada
  • Fecha PiP ao retornar à tela de teclado
  • Oculta widget flutuante e bloqueia auto-open enquanto PiP está ativo
  • Remove implementação legada (canvas/video) de picture-in-picture.ts

@xandfcosta xandfcosta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Componentes desalinhados e soundwave quebrada

Image

Ícone de carregamento quebrado

Image

Ao fazer a ligação, a foto de perfil não carrega, o PIP está abrindo antes da confirmação do servidor

Image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pode remover isso aq, você tá dando permissão pro Claude rodar comandos arbitrários na sua máquina

setIsClosed(isPipActive);
}, [isPipActive, setIsClosed]);

const handleMouseUp = useCallback(() => stopDrag(), [stopDrag]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pra que vc criou um wrapper pro stopDrag?

Comment on lines +72 to +82
{pipWindow &&
createPortal(
<div
className={`wv:fixed wv:inset-0 wv:flex wv:flex-col wv:items-center wv:justify-center wv:bg-background wv:overflow-hidden wv:m-0 wv:p-0 ${resolvedTheme}`}
>
<div className="wv:h-full wv:w-full wv:flex wv:flex-col">
{screen === "keyboard" ? <OutgoingScreen /> : callScreens}
</div>
</div>,
pipWindow.document.body,
)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transforme isso em um componente


return (
<>
{!isPipActive && <StatusBar />}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Por que vai sumir a StatusBar do webphone quando o Pip estiver aberto, o portal nem manda isso pro PIP?

{screen === "outgoing" && <OutgoingScreen />}
{screen === "call" && <CallScreen />}
{screen === "keyboard" && <KeyboardScreen />}
{!pipWindow && callScreens}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Em alguns lugares você usa o isPipActive, outro !pipWindow. Mantenha um padrão

Comment on lines +157 to +158
const isPipRef = React.useRef(isPipActive);
isPipRef.current = isPipActive;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Você está setando o memos valor duas vezes, o React.useRef já inicializa a ref com o valor do isPipActive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants