Allow host page to restrict which parts of the page can be annotated
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript
- Área
- frontend
Línea de trabajo
Empieza comparando los tres enfoques propuestos: una opción de configuración, un evento DOM y una API de JavaScript. Revisa los puntos de integración existentes del cliente para determinar qué enfoque encaja y, después, define la API elegida y sus restricciones de anotación; el trabajo estará terminado cuando la página anfitriona pueda restringir de forma fiable la anotación a elementos seleccionados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
In the context of video transcript annotation, we want some way to constrain annotation to the transcript.
A possible solution is some generic mechanism which allows the page embedding Hypothesis to control which element(s) can be annotated. Some ideas for API:
1. Configuration option
Add a configuration option to the client which specifies element(s) that can be annotated. The configuration should support a serializable representation of the element (eg. CSS selector, element ID), for cases where the configuration is injected as JSON.
For example:
{
"contentRoot": "#some-container"
}
Or:
{
"contentElements": ["#container-a", "#container-b"]
}
2. DOM event
Dispatch a DOM event prior to showing the adder, which the host page can intercept to prevent annotation or modify the annotated range. Example of how the host page might achieve this:
document.body.addEventListener('hypothesis:beforeannotate', event => {
// Modify `event.range` to alter the annotated range, or
// `event.preventDefault()` to prevent annotation of this region
});
3. JS API
Expose a JavaScript API which allows the host page to interact with the client after it loads and configure behavior like this. We don't currently have any such API in place.
// TBD - How does the host page get the `hypothesisClient` object.
// As a property of a DOM event after the client loads, or via a callback specified
// in client configuration?
// Restrict annotation to `someElement`
hypothesisClient.setContentElements([someElement]);
- Lenguaje dominante
- Mustache
- Estrellas
- 743
- Forks
- 227
- Merge medio
- 6 min
- PR fusionados (30 d)
- 1
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de hypothesis/client
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
hypothesis/client#7592 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
hypothesis/client#7586 ·
-
Common anti-FOUC styling technique hides sidebar with `hypothesis-sidebar {visibility: hidden}`Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
hypothesis/client#7498 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
hypothesis/client#7341 ·
-
accessibility
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
hypothesis/client#7315 ·
Todos los issues de hypothesis/client
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 91/100
marimo-team/marimo#11768 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue priority: high size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
[Studio feedback] 对话内容向下滚动时执行过程吸顶时,由于背景色是透明的,导致执行过程标题与下面的具体执行内容重叠,导致了两行信息重叠显示;建议执行过程的背景色设置为会话界面的背景Abiertobug from-studio
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
esengine/DeepSeek-Reasonix#15044 ·
Los mantenedores suelen responder en 1 día
-
Web wizard: "Launch without Sandbox" can switch a Structured create to Terminal in the same clickAbiertoarea:web bug needs-triage P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agent-of-empires/agent-of-empires#5489 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[Bug]: 对话界面点击右上角设备管理后,无法返回Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
EKKOLearnAI/ekko-studio#3729 ·
Los mantenedores suelen responder en 1 día