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
8 changes: 6 additions & 2 deletions sippy-ng/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ export default [
},
rules: {
'no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'react/display-name': 'off',
'react/jsx-uses-react': 'warn',
Expand Down
2 changes: 1 addition & 1 deletion sippy-ng/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ const ChatInterfaceWrapper = () => {
return <ChatInterface mode="fullPage" conversationId={id} />
}

function App(props) {
function App(_props) {
const classes = useStyles()
const theme = useTheme()

Expand Down
4 changes: 2 additions & 2 deletions sippy-ng/src/bugs/BugButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { safeEncodeURIComponent } from '../helpers'
import PropTypes from 'prop-types'
import React, { useState } from 'react'

const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles((_theme) => ({
alignedButton: {
float: 'left',
},
}))

export default function BugButton(props) {
const classes = useStyles()
const [open, setOpen] = useState(false)
const [_open, _setOpen] = useState(false)

const text = `
The following test is failing more than expected:
Expand Down
2 changes: 1 addition & 1 deletion sippy-ng/src/bugs/FileBug.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ See the [sippy test details|${url}] for additional context.
})
}

const clearAlerts = () => {
const _clearAlerts = () => {
setSuccessAlert(null)
setErrorAlert('')
setIsValidationError(false)
Expand Down
6 changes: 3 additions & 3 deletions sippy-ng/src/build_clusters/BuildClusterHealthChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export default function BuildClusterHealthChart(props) {
return <p>Loading...</p>
}

let periodCount = 14
let _periodCount = 14
if (props.period === 'hour') {
periodCount = 24
_periodCount = 24
}

let lastPeriodsSet = new Set()
Expand All @@ -70,7 +70,7 @@ export default function BuildClusterHealthChart(props) {
plugins: {
tooltip: {
callbacks: {
label: function (context, index) {
label: function (context, _index) {
return `${context.dataset.label} ${context.formattedValue}% (${
data[context.dataset.label].by_period[context.label].current_runs
} runs)`
Expand Down
6 changes: 3 additions & 3 deletions sippy-ng/src/build_clusters/BuildClusterOverview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import BuildClusterTable from './BuildClusterTable'
import Grid from '@mui/material/Grid'
import InfoIcon from '@mui/icons-material/Info'

const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles((_theme) => ({
root: {
flexGrow: 1,
},
Expand All @@ -21,8 +21,8 @@ const useStyles = makeStyles((theme) => ({
},
}))

export default function BuildClusterOverview(props) {
const classes = useStyles()
export default function BuildClusterOverview(_props) {
const _classes = useStyles()

return (
<Container size="xl">
Expand Down
2 changes: 1 addition & 1 deletion sippy-ng/src/build_clusters/BuildClusterTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import PassRateIcon from '../components/PassRateIcon'
import PropTypes from 'prop-types'
import React, { useEffect } from 'react'

const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles((_theme) => ({
root: {
'& .wrapHeader .MuiDataGrid-columnHeaderTitle': {
textOverflow: 'ellipsis',
Expand Down
2 changes: 1 addition & 1 deletion sippy-ng/src/chat/AskSippyButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Alert from '@mui/material/Alert'
import PropTypes from 'prop-types'
import React, { useContext, useState } from 'react'

const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles((_theme) => ({
defaultStyledButton: {
background: 'linear-gradient(45deg, #2196F3 30%, #21CBF3 90%)',
boxShadow: '0 3px 5px 2px rgba(33, 203, 243, .3)',
Expand Down
24 changes: 16 additions & 8 deletions sippy-ng/src/chat/ChatInterface.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,20 +191,28 @@ export default function ChatInterface({
const [isMaximized, setIsMaximized] = useState(false)

// Get state and actions from custom hooks
const { sessions, activeSessionId, activeSession } = useSessionState()
const {
sessions: _sessions,
activeSessionId,
activeSession,
} = useSessionState()
const {
initializeSessions,
createSession,
switchSession,
deleteSession,
createSession: _createSession,
switchSession: _switchSession,
deleteSession: _deleteSession,
forkActiveSession,
} = useSessionActions()

const { shareLoading, loadingShared } = useShareState()
const { shareLoading: _shareLoading, loadingShared } = useShareState()
const { clearSharedUrl, loadSharedConversationFromAPI } = useShareActions()

const { connectionState, isTyping, error, currentThinking } =
useConnectionState()
const {
connectionState,
isTyping: _isTyping,
error,
currentThinking,
} = useConnectionState()
const { settings, ensureClientId } = useSettings()

// Get messages from active session
Expand All @@ -220,7 +228,7 @@ export default function ChatInterface({
const { messagesEndRef, messagesListRef, lastMessageRef } =
useScrollManagement(activeSessionId, activeSession, messages, settings)

const isConnected = connectionState === CONNECTION_STATES.CONNECTED
const _isConnected = connectionState === CONNECTION_STATES.CONNECTED

// Initialize sessions and client ID on mount
useEffect(() => {
Expand Down
5 changes: 2 additions & 3 deletions sippy-ng/src/chat/ChatMessage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@mui/icons-material'
import { formatChatTimestamp, humanize, MESSAGE_TYPES } from './chatUtils'
import { Link } from 'react-router-dom'
import { makeStyles, useTheme } from '@mui/styles'
import { makeStyles } from '@mui/styles'
import { useModels } from './store/useChatStore'
import MessageChart from './MessageChart'
import PropTypes from 'prop-types'
Expand All @@ -19,7 +19,6 @@ import remarkGfm from 'remark-gfm'

// Custom link component for ReactMarkdown that opens external links in new tabs
const ChatLink = ({ href, children, ...props }) => {
const theme = useTheme()
const isExternal =
href && (href.startsWith('http://') || href.startsWith('https://'))

Expand Down Expand Up @@ -284,7 +283,7 @@ const useStyles = makeStyles((theme) => ({
export default function ChatMessage({
message,
showTimestamp = true,
showTools = true,
showTools: _showTools = true,
}) {
const classes = useStyles()
const { models } = useModels()
Expand Down
2 changes: 1 addition & 1 deletion sippy-ng/src/chat/MessageChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function MessageChart({ visualizations }) {
}
}

const handleExpandChart = (viz, index) => {
const handleExpandChart = (viz, _index) => {
const expandedLayout = {
...viz.layout,
paper_bgcolor: theme.palette.background.default,
Expand Down
2 changes: 1 addition & 1 deletion sippy-ng/src/chat/store/personaSlice.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Persona slice - manages available chat personas
*/
export const createPersonaSlice = (set, get) => ({
export const createPersonaSlice = (set, _get) => ({
personas: [],
personasLoading: false,
personasError: null,
Expand Down
2 changes: 1 addition & 1 deletion sippy-ng/src/chat/store/promptsSlice.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Zustand slice for managing slash command prompts
*/
export const createPromptsSlice = (set, get) => ({
export const createPromptsSlice = (set, _get) => ({
// State
prompts: [],
promptsLoading: false,
Expand Down
4 changes: 2 additions & 2 deletions sippy-ng/src/chat/store/sessionSlice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const createSessionSlice = (set, get) => ({
setCurrentThinking,
setError,
setIsTyping,
connectionState,
connectionState: _connectionState,
sendMessage,
} = get()

Expand Down Expand Up @@ -319,7 +319,7 @@ export const createSessionSlice = (set, get) => ({
// Message operations - operate on messages within the active session
// Add a message to the active session
addMessage: (message) => {
const { activeSessionId, sessions } = get()
const { activeSessionId, sessions: _sessions } = get()
if (!activeSessionId) {
console.warn('Cannot add message: no active session')
return
Expand Down
2 changes: 1 addition & 1 deletion sippy-ng/src/chat/store/shareSlice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export const createShareSlice = (set, get) => ({
},
})
})
.catch((err) => {
.catch((_err) => {
set({
shareSnackbar: {
open: true,
Expand Down
2 changes: 1 addition & 1 deletion sippy-ng/src/component_readiness/AddRegressionPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React, { Fragment } from 'react'
import RegressionPotentialMatchesTab from './RegressionPotentialMatchesTab'
import TriageFields from './TriageFields'

const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles((_theme) => ({
noMatchesMessage: {
textAlign: 'center',
padding: '8px',
Expand Down
6 changes: 3 additions & 3 deletions sippy-ng/src/component_readiness/AdvancedOptions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Typography from '@mui/material/Typography'

export default function AdvancedOptions(props) {
const {
headerName,
headerName: _headerName,
confidence,
pity,
minFail,
Expand Down Expand Up @@ -71,7 +71,7 @@ export default function AdvancedOptions(props) {
const handleChangeMinFail = (event, newValue) => {
setMinFail(newValue)
}
const handleChangePassRateNewTests = (event, newValue) => {
const handleChangePassRateNewTests = (event, _newValue) => {
let value = parseInt(event.target.value, 10)

if (value < 0) {
Expand All @@ -81,7 +81,7 @@ export default function AdvancedOptions(props) {
}
setPassRateNewTests(value)
}
const handleChangePassRateAllTests = (event, newValue) => {
const handleChangePassRateAllTests = (event, _newValue) => {
let value = parseInt(event.target.value, 10)

if (value < 0) {
Expand Down
2 changes: 1 addition & 1 deletion sippy-ng/src/component_readiness/CompCapTestRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import TableRow from '@mui/material/TableRow'
export default function CompCapTestRow(props) {
const classes = useContext(ComponentReadinessStyleContext)

const { testCols, columnNames } = props
const { testCols, columnNames: _columnNames } = props

// Put the testName on the left side with no link.
const testNameColumn = (
Expand Down
6 changes: 3 additions & 3 deletions sippy-ng/src/component_readiness/CompReadyEnvCapabilities.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import WarningsBanner from './WarningsBanner'
// Big query requests take a while so give the user the option to
// abort in case they inadvertently requested a huge dataset.
let abortController = new AbortController()
const cancelFetch = () => {
const _cancelFetch = () => {
console.log('Aborting page2a')
abortController.abort()
}
Expand Down Expand Up @@ -225,7 +225,7 @@ export default function CompReadyEnvCapabilities(props) {
<Typography className={classes.crCellCapabCol}>Name</Typography>
</TableCell>
{columnNames
.filter((column, idx) =>
.filter((column, _idx) =>
column.match(new RegExp(escapeRegex(searchColumnRegex), 'i'))
)
.map((column, idx) => {
Expand Down Expand Up @@ -273,7 +273,7 @@ export default function CompReadyEnvCapabilities(props) {
key={componentIndex}
capabilityName={data.rows[componentIndex].capability}
results={data.rows[componentIndex].columns.filter(
(column, idx) =>
(column, _idx) =>
formColumnName(column).match(
new RegExp(escapeRegex(searchColumnRegex), 'i')
)
Expand Down
6 changes: 3 additions & 3 deletions sippy-ng/src/component_readiness/CompReadyEnvCapability.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import WarningsBanner from './WarningsBanner'
// Big query requests take a while so give the user the option to
// abort in case they inadvertently requested a huge dataset.
let abortController = new AbortController()
const cancelFetch = () => {
const _cancelFetch = () => {
console.log('Aborting page3')
abortController.abort()
}
Expand Down Expand Up @@ -219,7 +219,7 @@ export default function CompReadyEnvCapability(props) {
<Typography className={classes.crCellCapabCol}>Name</Typography>
</TableCell>
{columnNames
.filter((column, idx) =>
.filter((column, _idx) =>
column.match(new RegExp(escapeRegex(searchColumnRegex), 'i'))
)
.map((column, idx) => {
Expand Down Expand Up @@ -269,7 +269,7 @@ export default function CompReadyEnvCapability(props) {
testName={data.rows[componentIndex].test_name}
testId={data.rows[componentIndex].test_id}
results={data.rows[componentIndex].columns.filter(
(column, idx) =>
(column, _idx) =>
formColumnName(column).match(
new RegExp(escapeRegex(searchColumnRegex), 'i')
)
Expand Down
16 changes: 8 additions & 8 deletions sippy-ng/src/component_readiness/CompReadyEnvCapabilityTest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import WarningsBanner from './WarningsBanner'
// Big query requests take a while so give the user the option to
// abort in case they inadvertently requested a huge dataset.
let abortController = new AbortController()
const cancelFetch = () => {
const _cancelFetch = () => {
console.log('Aborting page4')
abortController.abort()
}
Expand All @@ -58,8 +58,8 @@ export default function CompReadyEnvCapabilityTest(props) {
'searchRow',
StringParam
)
const [searchRowRegex, setSearchRowRegex] = useState(searchRowRegexURL)
const handleSearchRowRegexChange = (event) => {
const [_searchRowRegex, setSearchRowRegex] = useState(searchRowRegexURL)
const _handleSearchRowRegexChange = (event) => {
const searchValue = event.target.value
setSearchRowRegex(searchValue)
}
Expand All @@ -68,9 +68,9 @@ export default function CompReadyEnvCapabilityTest(props) {
'searchColumn',
StringParam
)
const [searchColumnRegex, setSearchColumnRegex] =
const [_searchColumnRegex, setSearchColumnRegex] =
useState(searchColumnRegexURL)
const handleSearchColumnRegexChange = (event) => {
const _handleSearchColumnRegexChange = (event) => {
const searchValue = event.target.value
setSearchColumnRegex(searchValue)
}
Expand All @@ -79,12 +79,12 @@ export default function CompReadyEnvCapabilityTest(props) {
'redOnly',
BooleanParam
)
const [redOnlyChecked, setRedOnlyChecked] = React.useState(redOnlyURL)
const handleRedOnlyCheckboxChange = (event) => {
const [_redOnlyChecked, setRedOnlyChecked] = React.useState(redOnlyURL)
const _handleRedOnlyCheckboxChange = (event) => {
setRedOnlyChecked(event.target.checked)
}

const clearSearches = () => {
const _clearSearches = () => {
setSearchRowRegex('')
if (searchRowRegexURL && searchRowRegexURL !== '') {
setSearchRowRegexURL('')
Expand Down
2 changes: 1 addition & 1 deletion sippy-ng/src/component_readiness/CompReadyMainInputs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function CompReadyMainInputs({ controlsOpts }) {
])

const varsContext = useContext(CompReadyVarsContext)
const navigate = useNavigate()
const _navigate = useNavigate()
const compReadyEnvOptions = (
<div>
<GroupByCheckboxList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function CompReadyTestDetailRow(props) {
} = props

const handlerForJobRunSelect = (jobId) => {
return (element) => {
return (_element) => {
if (searchJobRunIds.has(jobId)) {
setSearchJobRunIds(searchJobRunIds.difference(new Set([jobId])))
} else {
Expand Down
Loading