Skip to content

Update Ask Bar Styling, New Tab Fade, New Placeholder Text#27

Open
elliothco wants to merge 3 commits intosolbrowse:mainfrom
elliothco:main
Open

Update Ask Bar Styling, New Tab Fade, New Placeholder Text#27
elliothco wants to merge 3 commits intosolbrowse:mainfrom
elliothco:main

Conversation

@elliothco
Copy link
Copy Markdown
Contributor

@elliothco elliothco commented Jul 1, 2025

I made some small visual tweaks to improve the UI and fix a few glitches.

Updated Askbar Styling

  • Decreased top-padding to not take up unneeded space
  • Added back the margin-top on the generated text so that the user's question isn't covered up by the fade on first question ask
  • Adjusted padding & fade between the bottom text and the top of the textbox for a smoother look
Screenshot 2025-07-01 at 12 31 39 PM

New Tab Page Chat Fading

Add in a visually similar fade to the new tab chat. This also fixes the visual issue of text scrolling underneath the question box
Screenshot 2025-07-01 at 12 39 36 PM

Updated Placeholder Text

Updated Sol's placeholder text to better reflect the multiple ways to access Sol. It felt awkward for the new tab page, with no pages yet attached, to say "Ask a question about this page"

Screenshot 2025-07-01 at 12 33 28 PM

Small note: I noticed that due to my editor's auto formatting, a lot of formatting on the first commit was mistakenly /unnecessarily changed in the files I edited. Coderabbit, if you want to simplify this PR into what actually changed and remove the unnecessary file syntax changes, please go ahead.

Summary by CodeRabbit

  • New Features
    • Introduced a new background gradient style for certain interface elements.
  • Style
    • Improved consistency in code formatting and indentation across multiple components.
    • Enhanced visual appearance of fade effects and gradient backgrounds.
  • Chores
    • Standardized use of double quotes and cleaned up whitespace for better code readability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 1, 2025

Walkthrough

This update primarily standardizes code style and formatting across several files, including consistent use of double quotes, improved indentation, and clearer multiline formatting. The only semantic changes are in the CSS: .sol-fade-mask is updated, a new .sol-ask-gradient-bg class is added, and a container in NewTabPage.tsx uses the new gradient background class.

Changes

File(s) Change Summary
src/assets/styles/chat.css Reformatted indentation; removed max-height from .sol-fade-mask; adjusted gradient stops; added .sol-ask-gradient-bg class.
src/components/shared/InputArea.tsx Standardized to double quotes; improved indentation and whitespace; no logic changes.
src/pages/askbar/AskBar.tsx Standardized double quotes; expanded object literals and JSX for readability; no logic changes.
src/pages/newtab/NewTabPage.tsx Standardized double quotes; improved JSX formatting; added sol-ask-gradient-bg pt-12 classes to input container.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant NewTabPage
    participant InputArea
    participant Stylesheet

    User->>NewTabPage: Loads new tab page
    NewTabPage->>Stylesheet: Applies .sol-ask-gradient-bg to input container
    NewTabPage->>InputArea: Renders input area
    InputArea-->>User: Displays input with placeholder
Loading

Possibly related PRs

Poem

A rabbit hopped through fields of code,
Tidying quotes and lines in every node.
A gradient dawn now softly glows,
Where questions bloom and knowledge grows.
With every hop, the styles align—
Oh, how this code begins to shine!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/components/shared/InputArea.tsx

Oops! Something went wrong! :(

ESLint: 9.30.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

src/pages/askbar/AskBar.tsx

Oops! Something went wrong! :(

ESLint: 9.30.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

src/pages/newtab/NewTabPage.tsx

Oops! Something went wrong! :(

ESLint: 9.30.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10b6e5f and 3e4f586.

📒 Files selected for processing (3)
  • src/components/shared/InputArea.tsx (9 hunks)
  • src/pages/askbar/AskBar.tsx (8 hunks)
  • src/pages/newtab/NewTabPage.tsx (7 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/components/shared/InputArea.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/pages/newtab/NewTabPage.tsx
  • src/pages/askbar/AskBar.tsx
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
src/pages/askbar/AskBar.tsx (1)

78-83: Remove the setPageUrl call after deleting the unused state.

-  (message) => {
-    setCurrentTabId(message.tabId);
-    setPageUrl(message.url);
-  },
+  (message) => {
+    setCurrentTabId(message.tabId);
+  },
🧹 Nitpick comments (4)
src/assets/styles/chat.css (1)

672-674: Consider moving the padding from markup into the new helper class.

sol-ask-gradient-bg is always used together with extra top-padding (pt-12). Co-locating that padding inside the class keeps styling concerns in CSS and avoids duplicated utility classes in JSX.

-.sol-ask-gradient-bg {
-    background: linear-gradient(to top, #f7f8fa 76%, transparent 100%);
-}
+.sol-ask-gradient-bg {
+    background: linear-gradient(to top, #f7f8fa 76%, transparent 100%);
+    padding-top: 3rem; /* tailwind pt-12 */
+}

Then drop the explicit pt-12 from the calling components.

src/components/shared/InputArea.tsx (1)

64-73: Missing dropdownRef in effect dependency may cause stale layout.

useEffect mutates dropdownRef.current.style but dropdownRef is not listed in the dependency array.
If this ref changes (e.g. component remount), the effect won’t run and the dropdown could be misplaced.

-  }, [showDropdown, filteredTabs.length]);
+  }, [showDropdown, filteredTabs.length, dropdownRef]);
src/pages/newtab/NewTabPage.tsx (2)

70-74: Prefer a utility class instead of inline backgroundColor.

Tailwind already ships bg-white; using it keeps the JSX uncluttered and allows future theming to toggle classes instead of inline styles.

-  style={{
-    backgroundColor: "white",
-  }}
+  className="bg-white"

152-153: Double top-padding inflates the sticky bar.

p-6 applies pt-6; adding pt-12 on the same element results in 18 px of top padding.
Unless the extra 12 px is intentional, it’s cleaner to rely solely on the helper class (see CSS comment) or change to:

-<div className="sticky bottom-0 left-0 right-0 p-6 sol-ask-gradient-bg pt-12">
+<div className="sticky bottom-0 left-0 right-0 px-6 pb-6 sol-ask-gradient-bg">
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a306ed and 10b6e5f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • src/assets/styles/chat.css (1 hunks)
  • src/components/shared/InputArea.tsx (9 hunks)
  • src/pages/askbar/AskBar.tsx (12 hunks)
  • src/pages/newtab/NewTabPage.tsx (7 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/pages/askbar/AskBar.tsx (2)
src/scripts/content/PortManager.ts (1)
  • portManager (55-55)
src/types/messaging.ts (2)
  • IframeCurrentTabResponseMsg (115-120)
  • IframeGetCurrentTabMsg (111-113)

Comment on lines 658 to +670
/* Fade mask for subtle chat fade effect */
.sol-fade-mask {
max-height: 400px;
overflow-y: auto;
mask-image: linear-gradient(
to bottom,
transparent 2%,
black 5%,
black 95%,
transparent 98%
);
mask-repeat: no-repeat;
mask-mode: alpha;
overflow-y: auto;
mask-image: linear-gradient(
to bottom,
transparent 2%,
black 5%,
black 94%,
transparent 100%
);
mask-repeat: no-repeat;
mask-mode: alpha;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add WebKit prefix to guarantee mask support in Safari / iOS.

mask-image is not (yet) supported by Safari without the -webkit- prefix. On WebKit browsers the fade will silently fail, so the conversation text will scroll hard-cut underneath the input bar.
Add the prefixed declaration right next to the standard one.

     mask-image: linear-gradient(
         to bottom,
         transparent 2%,
         black 5%,
         black 94%,
         transparent 100%
     );
+    -webkit-mask-image: linear-gradient(
+        to bottom,
+        transparent 2%,
+        black 5%,
+        black 94%,
+        transparent 100%
+    );
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/* Fade mask for subtle chat fade effect */
.sol-fade-mask {
max-height: 400px;
overflow-y: auto;
mask-image: linear-gradient(
to bottom,
transparent 2%,
black 5%,
black 95%,
transparent 98%
);
mask-repeat: no-repeat;
mask-mode: alpha;
overflow-y: auto;
mask-image: linear-gradient(
to bottom,
transparent 2%,
black 5%,
black 94%,
transparent 100%
);
mask-repeat: no-repeat;
mask-mode: alpha;
}
/* Fade mask for subtle chat fade effect */
.sol-fade-mask {
overflow-y: auto;
mask-image: linear-gradient(
to bottom,
transparent 2%,
black 5%,
black 94%,
transparent 100%
);
-webkit-mask-image: linear-gradient(
to bottom,
transparent 2%,
black 5%,
black 94%,
transparent 100%
);
mask-repeat: no-repeat;
mask-mode: alpha;
}
🤖 Prompt for AI Agents
In src/assets/styles/chat.css around lines 658 to 670, the CSS uses mask-image
without the -webkit- prefix, causing the fade effect to fail on Safari/iOS. Add
the -webkit-mask-image property with the same linear-gradient value immediately
after the mask-image declaration to ensure compatibility with WebKit browsers.

Comment on lines 24 to 28
const [hasAutoAddedCurrentTab, setHasAutoAddedCurrentTab] = useState(false);
const [currentTabId, setCurrentTabId] = useState<number | null>(null);
const [pageUrl, setPageUrl] = useState<string>('');
const [position, setPosition] = useState<string>('top-right');
const [pageUrl, setPageUrl] = useState<string>("");
const [position, setPosition] = useState<string>("top-right");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

pageUrl state is never read – remove dead code.

pageUrl is set but never consumed anywhere in the component, which will trip no-unused-vars / @typescript-eslint/no-unused-vars and needlessly re-renders on every tab-change.

-const [pageUrl, setPageUrl] = useState<string>("");

…and drop every setPageUrl(...) call below.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/pages/askbar/AskBar.tsx around lines 24 to 28, the pageUrl state variable
is declared and set but never used anywhere in the component, causing
unnecessary re-renders and lint errors. Remove the declaration of pageUrl and
its setter useState<string>(""), and also remove all calls to setPageUrl(...)
throughout the component to eliminate this dead code.

@elliothco
Copy link
Copy Markdown
Contributor Author

I removed the updated placeholder text, as it seems there is adjustments to the placeholder text currently being made

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