-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pseudo-tabs for the currently opened page #8
Comments
Overview:As discussed in the W3 Committee on April 30, 2024, the currently opened page will be displayed in a "tab" in the header as shown in the image below.
|
Looks good! Thanks for tackling this! |
Oh yeah, one note, I think this component should be separate to the Navbar component, and can maybe exist in the /lib/VSCode/navigation folder. It can then be used at an app-level like so: function App() {
return (
<>
<VSCode.Navbar view={view} ... />
<VSCode.TabView view={view} ... />
(the actual page)
</>
);
} or function App() {
return (
<>
<VSCode.Navbar view={view} ... />
<div className='flex flex-col items-start justify-start'>
<VSCode.Tabs view={view} ... />
(the actual page)
</div>
</>
);
} Up to you though! |
Screenshots of the implementation are given in the PR! Design issues@harjotsk03 @micahdbak I ran into some difficulties working with the current architecture/design of the example site. Could consider opening a separate issue. 1.
|
Ah, yes, we should definitely change this to work with a CSS Grid or Flexbox!
I'm adamant about not using the History API, as it tends to be wonky when served as compiled files (something we need to do if we want to serve static files in addition to React files). Maybe we can use hash-routing (see this React Router page); I'll look into implementing this! It shouldn't refresh the page (as anchors are intended to just jump to a part of the page, not refresh), so that would be a nice edge over search params, and it would work with static files. Hashrouting example: I'll make a task for this and implement it.
Gross. OK, I'm against search params now for sure. I'll setup HashRouter as the primary routing means |
I'm going to look over your PR now! |
@dayvidpham , new idea for this component, over the tabs idea, which is to implement something like this: @EarthenSky raised that having file tabs might be a little distracting (browsers already have tabs), and not very useful if we only have one tab open. A better design is a "breadcrumb" about the current page, and maybe how deep you currently are in the page (e.g., sections, etc.). For now the breadcrumb could be as simple as displaying the file name and parent folder, such as import { useLocation } from 'react-router-dom';
function NavBreadcrumb(props) {
const location = useLocation();
const { crumbs } = props;
const crumb = crumbs[location.pathname]; // pathname is '/', '/officers', ...
// ...
}
<NavBreadcrumb
crumbs={{
"/": "README.md",
"/officers": "about > officers.txt",
...
}}
> Thoughts? |
I did say this, but @micahdbak made a good point a while ago that not having file tabs makes the design look a lil wonky. I think the file tab & the breadcrumbs might be able to work together, having the breadcrumbs fill the empty area to the right of the tab. I think having multiple open tabs would not be very helpful if the content of the page is just information about our club. If the page content is something the user is editing, or it's about multiplexing content smaller than the entire page (say a tabbed table or something embedded in the page), the affordance would be nice. |
You can extract the view through props passed into Navbar, ..., or create a second component.
The text was updated successfully, but these errors were encountered: