Skip to content
Merged
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
@@ -1 +1 @@
* Add: Jupyter notebook table output style tweaks
* Fix: Slack link - remove trailing slash from `questionId` to fix auto scroll to the question
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Fix: [Jupyter](snippets/jupyter-notebook) `includeSection` to handle section delimiter that has other text below it
16 changes: 16 additions & 0 deletions znai-reactjs/src/doc-elements/text-selection/HighlightedText.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 znai maintainers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

.znai-highlight-question-bubble {
display: none;
position: absolute;
Expand Down
19 changes: 18 additions & 1 deletion znai-reactjs/src/doc-elements/text-selection/HighlightedText.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 znai maintainers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import React, { useEffect, useRef, useState } from "react";
import { TextHighlighter } from "./textHighlighter";

Expand All @@ -7,6 +23,7 @@ import { createPortal } from "react-dom";
import { afterTitleId } from "../../layout/classNamesAndIds";

import "./HighlightedText.css";
import { removeTrailingSlashFromQueryParam } from "./queryParamUtils";

interface Props {
containerNode: HTMLDivElement;
Expand All @@ -29,7 +46,7 @@ export function HighlightedText({
displayBubbleAndScrollIntoView,
additionalView,
}: Props) {
const cleanedUpQuestion = question.endsWith("/") ? question.substring(0, question.length - 1) : question;
const cleanedUpQuestion = removeTrailingSlashFromQueryParam(question);

const bubbleRef = useRef<HTMLDivElement>(null);
const detachedQuestionRef = useRef<HTMLDivElement>(null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 znai maintainers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

.resolve-question-button {
background: none;
border: none;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 znai maintainers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import React, { useState, useEffect, useRef } from "react";
import "./ResolveQuestionButton.css";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 znai maintainers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

.znai-highlight-bubble-resolve-and-link {
display: flex;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 znai maintainers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import React, { useEffect, useState } from "react";
import { currentPageId, pageIdFromTocItem } from "../../structure/DocumentationNavigation";
import { getDocMeta } from "../../structure/docMeta";
Expand All @@ -7,6 +23,7 @@ import { TocItem } from "../../structure/TocItem";

import { ResolveQuestionButton } from "./ResolveQuestionButton";
import "./SlackActiveQuestions.css";
import { removeTrailingSlashFromQueryParam } from "./queryParamUtils";

interface Question {
id: string;
Expand Down Expand Up @@ -113,6 +130,8 @@ export function SlackActiveQuestions({ containerNode, tocItem }: { containerNode
</div>
);

const cleanedUpQuestionId = removeTrailingSlashFromQueryParam(questionId);

return (
<HighlightedText
key={question.slackMessageTs}
Expand All @@ -123,7 +142,7 @@ export function SlackActiveQuestions({ containerNode, tocItem }: { containerNode
question={question.question}
context={question.context}
additionalView={additionalView}
displayBubbleAndScrollIntoView={!!questionId && question.id === questionId}
displayBubbleAndScrollIntoView={!!cleanedUpQuestionId && question.id === cleanedUpQuestionId}
/>
);
});
Expand Down
23 changes: 23 additions & 0 deletions znai-reactjs/src/doc-elements/text-selection/queryParamUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2025 znai maintainers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export function removeTrailingSlashFromQueryParam(value: string | undefined) {
if (!value) {
return value;
}

return value.endsWith("/") ? value.substring(0, value.length - 1) : value;
}
16 changes: 16 additions & 0 deletions znai-reactjs/src/doc-elements/text-selection/textHighlighter.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 znai maintainers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

.znai-highlight {
background-color: #ffeb3b;
color: black;
Expand Down